Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / components / ImageComponent

Class: ImageComponent

Defined in: components/Image.ts:13

Renders a 2D image as a textured quad in the scene. Width/height are in world units. Texture loading is handled by the image system, which populates ImageComponent.texture and ImageComponent.object asynchronously.

Extends

Constructors

Constructor

ts
new ImageComponent(
   path, 
   width?, 
   height?): ImageComponent;

Defined in: components/Image.ts:25

Parameters

ParameterTypeDefault value
pathstringundefined
widthnumber1
heightnumber1

Returns

ImageComponent

Overrides

Component.constructor

Properties

PropertyTypeDescriptionDefined in
pathstringSource URL or localasset:// path of the image file.components/Image.ts:15
widthnumberWidth of the rendered quad in world units.components/Image.ts:17
heightnumberHeight of the rendered quad in world units.components/Image.ts:19
textureTexture | nullLoaded texture, populated asynchronously by the image system. null until loaded.components/Image.ts:21
objectObject3D<Object3DEventMap> | nullLive three.js object representing the textured quad. null until built.components/Image.ts:23