Home | Documentation | Atomic Chat | Github

How can I create an image button?


How can I create an image button? I seen examples of default buttons all over the pace but none of them shows how to create an image button. Here is what I’m going to do: I have 3 button images and each of them represent a corresponding state: normal, pressed, disabled.
Thank you very much!


To make a button that is an image requires some configuration in your local skin file. This is demonstrated in the UIPeriodicTable example program. On the UIButton page, this is what you will see :
The duck “button” has a normal state image, and a pressed state image, and these are configured in the skin file, Textures/desktop.tb.txt as DuckButton, DuckButton.pressed.
There is no need for a disabled image, by setting the widget state to Atomic.UI_WIDGET_STATE_DISABLED, the widget is automagically dimmed/grayed out as


Thanks for your help!
BTW, can I use images from the sprite sheet instead of individual png files for my image buttons?
One more question: is there any editors I can use to design my UI visually instead of typing text file?


I do not know of a way to use a spritesheet as button skins, though there may be something in the bitmap definition that allows that, it is an area of Turbobadger I have not explored.
There currently is no gui builder :frowning: