Skip to main content

<image>

Renders an image asset into the world.

Props

PropTypeDescriptionDefault
srcStringPath to the image file in your assets folder.
widthNumberWidth of the image. See notes for more info. Optional.
heightNumberHeight of the image. See notes for more info. Optional.
colorStringColor of the canvas while image is loading.white
frameWidthNumberThe width of the frame around the image.0
frameDepthNumberThe depth of the frame.0
frameColorNumberThe color of the frame.black
opacityNumberOpacity of the image.1
positionArrayPosition of the image.[0,0,0]
rotationArrayRotation of the image.[0,0,0]
onHoverEnterFunctionCalled when an avatar hovers over the image. Provides an Event
onHoverLeaveFunctionCalled when an avatar hovers out of the image. Provides an Event
onPointerDownFunctionCalled when avatar presses the pointer down over this object.
onPointerDownHintStringText displayed when hovering over this object when onPointerDown is defined.
onPointerUpFunctionCalled when avatar releases the pointer over this object.
onPointerUpHintStringText displayed when hovering over this object with the pointer down and onPointerUp is defined.
hitDistanceNumberMaximum distance to interact with this node.3

Notes

  • If only width is set, height is automatically calculated to maintain aspect ratio
  • If only height is set, width is automatically calculated to maintain aspect ratio
  • If both width and height are set, the image will cover these dimensions, similar to the background-size: cover functionality in CSS.
  • If neither height or width is set, the image will be displayed with a height of 1 and width will be automatically calculated to maintain aspect ratio