Constructor
new Sprite(tile, parent, name)
Constructs a new Sprite type node.
Parameters:
Name | Type | Description |
---|---|---|
tile |
Tile | The initial tile of the sprite |
parent |
Obj | The parent node of the newly created. Adds the created to the parents children (same as in Obj#constructor) |
name |
string | The name of the node (see Obj#constructor) |
Example
// add a sprite to the scene (could be found in Apate#init)
new World.Sprite(Tile.fromImage(<img>), this.scene, "demo-sprite")
Extends
- Obj
Members
align :"center"|"corner"
Alignment of the sprite.
material :SpriteMaterial
The material of the sprite used for drawing.
tile :Tile
The tile of the sprite. Shorthand for tile.material.sprite.