Dynamic image support for Button and Picture

Started by byronhaochen, 31 December 2024, 09:49:14

byronhaochen

Hi, how to implement dynamic image support for button and picture? :)

texus

What do you mean with "dynamic image support"? Just changing the texture?

You can change the texture in the widget renderer:
Code (cpp) Select
picture->getRenderer()->setTexture("image.png");


texus

Animated textures are not supported directly.

You would have to load each frame into a texture and then call the getRenderer()->setTexture() function with a different texture each time you want to update the visible frame.

byronhaochen

Quote from: texus on 31 December 2024, 11:58:49Animated textures are not supported directly.

You would have to load each frame into a texture and then call the getRenderer()->setTexture() function with a different texture each time you want to update the visible frame.
thank you