UI Image
Updated
An image element.
- Type
comp-ui-image- Script class
UIImageComponent- Per entity
- One
- Version
- 1.1.1
Read about it in Content: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
borderRadius |
||
border |
0 ≤ x ≤ 16384 |
|
borderWidth |
||
borderWidth[] |
0 ≤ x ≤ 16384 |
|
height |
0 ≤ x ≤ 16384 |
|
margin |
||
margin[] |
- |
|
padding |
||
padding[] |
0 ≤ x ≤ 16384 |
|
width |
0 ≤ x ≤ 16384 |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
UIImage::pressUIImage::readyUIImage::error
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
An image galleryA UI Image that steps through three pictures with Previous and Next buttons; the caption waits for the image's ready event and reports load errors.
Press Next and Previous to step through the pictures; the caption updates once each one has loaded. Drag outside the panel to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(UIImageComponent); if (component) log(component.props);}