Skip to content

@relu-interactives/spatial-ecs


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

Class: SpriteComponent

Defined in: components/Sprite.ts:11

Camera-facing 2D sprite. Unlike ImageComponent, sprites use THREE.Sprite and always render as billboards.

Extends

Constructors

Constructor

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

Defined in: components/Sprite.ts:23

Parameters

ParameterTypeDefault value
pathstringundefined
widthnumber1
heightnumber1

Returns

SpriteComponent

Overrides

Component.constructor

Properties

PropertyTypeDescriptionDefined in
pathstringSource URL or localasset:// path of the sprite image.components/Sprite.ts:13
widthnumberWidth of the sprite in world units.components/Sprite.ts:15
heightnumberHeight of the sprite in world units.components/Sprite.ts:17
textureTexture | nullLoaded texture, populated asynchronously. null until loaded.components/Sprite.ts:19
objectSprite<Object3DEventMap> | nullLive THREE.Sprite placed in the scene. null until built.components/Sprite.ts:21