Skip to content

Class: Sprite

Sprite is a component for storing information around a sprite and how it should be drawn. Contains information around the colour to use if no texture is provided and the z order for deciding which order to draw the sprite in. Can contain texture information such as bounds and a texture.

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

+ new Sprite(material: Material, zOrder?: number): Sprite

Parameters:

Name Type Default value
material Material -
zOrder number 0

Returns: Sprite

Inherited from: Component

Properties

key

key: string

Inherited from: Component.key


material

material: Material

Material to apply when rendering the Sprite.


transformedShape

transformedShape: AABB


zOrder

zOrder: number

Order which the sprite should appear, if it should appear infront/behind other objects, the higher the value the more precedence it is given and will appear in front of objects with a lower value.


KEY

Readonly Static KEY: sprite= "sprite"

Key of the sprite component.


MESSAGE_ADD

Readonly Static MESSAGE_ADD: component_add= "component_add"

Inherited from: Component.MESSAGE_ADD


MESSAGE_REMOVE

Readonly Static MESSAGE_REMOVE: component_remove= "component_remove"

Inherited from: Component.MESSAGE_REMOVE

Methods

Free

Free(): void

Returns: void

Overrides: Component