Suggestions for adding ImageButton components

I hope CGE can add a imagebutton component, there are four status:normal、hover 、pressed、disable (corresponding to 4 images),support text display on the image

This component is very common and can greatly improve the beauty of the UI

RPG GUI contruction kit v1.0 Made by Lamoot, released under CC-BY 3.0, all images used in the process are self made or from public domain sources.
Found at https://opengameart.org/content/rpg-gui-construction-kit-v10

I slightly modified to get four buttons pictures on the basis of RPG GUI contruction kit, for testing

btn_Stand_Grey_Normal
btn_Stand_Grey_Hover
btn_Stand_Grey_Pressed
btn_Stand_Grey_Disable
rpg_gui_v1
preview_6
ImageButton.zip (99.9 KB)
rpg_gui_v1.zip (2.8 MB)

TCastleButton already supports this. You just need to set CustomBackground = true and then fill in CustomBackgroundDisabled/focused(=hover)/normal/pressed

Indeed, and see examples/component_gallery/ for a demo how to use UI in various ways, including various TCastleButton setups.

Note that you need to provide now images for different state separately, but we also have PR to allow to use just an atlas for UI and choose regions from it: New property TRegion for TCastleImagePersistent allows selecting a cropped region from a UI image set by Freedomax · Pull Request #442 · castle-engine/castle-engine · GitHub .