Skip to content

GIF

Updated

An animated GIF surface.

Type
comp-gif
Script class
GIFComponent
Per entity
One
Version
1.1.0

Read about it in Images: what it does, how to use it from a script, and examples.

The props the runtime declares for this component, with their defaults and accepted ranges.

Prop Default Range
grayscale 0 ≤ x ≤ 1
height 0 ≤ x ≤ 10000
maxFps 1 ≤ x ≤ 60
opacity 0 ≤ x ≤ 1
speed 0 < x ≤ 16
width 0 ≤ x ≤ 10000
zoom 0.001 ≤ x ≤ 1000

Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.

  • GIF::ready
  • GIF::error
  • GIF::play
  • GIF::pause
  • GIF::end

Run it in the browser, read its scripts, and download it as an XR Creator project.

#pragma lifecycle(startup)
function startup() {
const component = self.parent.getComponent(GIFComponent);
if (component) log(component.props);
}