UIImage
Renders a texture or sprite within its rectangle, with color tint support.
Create in the Editor
- Ensure there is a
UIControllerin the scene. - Create a GameObject and add
UIRect. - Add the
UIImagecomponent.
How to Use
- Get the component with
myObject.findComponent(UIImage.class). - Read and write the component properties to control behavior.
- Test input or layout in Play mode.
Java Example
SpatialObject myObject = /* your object */;
UIImage comp = myObject.findComponent(UIImage.class);
if (comp != null) {
Texture tex = /* load texture */ null;
// set the border value:
comp.border = 1f;
// read the border value:
float borderValue = comp.border;
// set the color value:
comp.color = new Color(255, 255, 255, 255);
// read the color value:
Color colorValue = comp.color;
// set the texture value:
comp.texture = tex;
// read the texture value:
Texture textureValue = comp.texture;
}