With big thanks to Freedomax PR, our images in user interface are now much more powerful:
Every image has a region which defines a subset of the image to render. This allows to use a big atlas image to define a whole user interface like in this example UI on OpenGameArt and for each component just choose a suitable region of this atlas.
This is used for images in
TCastleButton(for custom button backgrounds),
TCastleScrollView(for scrollbar frame and slider). Going forward, 100% of UI should be customizable using
Moreover, our CGE editor gets a nice visual way to edit both regions (
TCastleImagePersistent.Region) and borders for 9-slices algorithm (
TCastleImagePersistent.ProtectedSides). Just click on the “…” button in the Object Inspector at them to fire a comfortable form to define a region / borders. Within the form, you can pan and zoom the image, to adjust them perfectly.