Class: Texture
Texture is the mapping from an image that has been loaded, deciding how the texture should be drawn and represented.
Implements
Table of contents
Constructors
Properties
Methods
Constructors
constructor
+ new Texture(image
: string, points?
: Polygon): Texture
Parameters:
Name | Type |
---|---|
image |
string |
points |
Polygon |
Returns: Texture
Properties
image
• image: string
Name of the image the texture refers to.
points
• points: Polygon
Mapping in points on the image.
Methods
Copy
▸ Copy(): Texture
Make a value copy of the texture.
Returns: Texture
Free
▸ Free(): void
Free releases an object or it's constituent parts back into any available object pools.
Returns: void
Implementation of: IFreeable
GenerateSpritesheetIndex
▸ Static
GenerateSpritesheetIndex(rowCount
: number, columnCount
: number): Polygon[]
GenerateSpritesheetIndex generates an indexed array of shapes to access each sprite in a sprite sheet. The sprite sheet must have all sprites the same width, and height - empty sprite positions work. The indexed sprite sheet operates from left to right, bottom to top. For example, the following shows the indexes of each position in the sprite sheet:
|---------| | 0 1 2 | | 3 4 5 | | 6 7 8 | |---------|
Parameters:
Name | Type | Description |
---|---|---|
rowCount |
number | number of rows in the sprite sheet (vertically). |
columnCount |
number | number of columns in the sprite sheet (horizontally). |
Returns: Polygon[]
- An indexed array of shapes to access each sprite.