Skip to main content

Class: SpriteComponent

Defined in: rendering/components/sprite-component.ts:8

The SpriteComponent class implements the Component interface and represents a component that contains a Sprite.

Extends

Constructors

Constructor

new SpriteComponent(sprite, enabled): SpriteComponent

Defined in: rendering/components/sprite-component.ts:20

Constructs a new instance of the SpriteComponent class with the given Sprite.

Parameters

sprite

Sprite

The Sprite instance to associate with this component.

enabled

boolean = true

Indicates whether the sprite is enabled or not (default: true).

Returns

SpriteComponent

Overrides

Component.constructor

Properties

enabled

enabled: boolean

Defined in: rendering/components/sprite-component.ts:13

Indicates whether the sprite is enabled or not.


sprite

sprite: Sprite

Defined in: rendering/components/sprite-component.ts:10

The Sprite instance associated with this component.

Accessors

id

Get Signature

get static id(): symbol

Defined in: ecs/types/Component.ts:12

The unique id of the component.

Returns

symbol

Inherited from

Component.id