new UISprite()
UISprite is a special Sprite class wihch is used to render Images on UI elements. This is a UI component, so it should be added to an entity with a UITransform component.
| Name | Type | Default | Description |
|---|---|---|---|
path | string | "" | The path to the image to display. |
- Source
Example
// Create a new entity with a UITransform component and a UISprite component.
let entity = new Entity();
entity.AddComponent(new UITransform());
entity.AddComponent(new UISprite("assets/sprites/texture.png"));Extends
Members
blendMode
Blend mode of the object
- Inherited From
- Source
filter
The filter applied to the object
- Inherited From
- Source
(readonly) properties
The entity that this component is attached to.
- Inherited From
- Source
Methods
deserialize(props)
Populates the component properties from a data object. Override this method for custom property handling.
Parameters:
| Name | Type | Description |
|---|---|---|
props | object | The properties object (usually from JSON). |
- Inherited From
- Source
drawChildren()
Draw this entity's nested renderables in deterministic order. @protected
- Inherited From
- Source