new SpriteMaterial(img, framesopt, actionsopt)
- Source:
- Implements:
Parameters:
Name |
Type |
Attributes |
Default |
Description |
img |
HTMLImageElement
|
|
|
Image to draw |
frames |
number
|
<optional>
|
1
|
Number of cutouts in the sprite in the X axis of the image. |
actions |
number
|
<optional>
|
1
|
Number of cutouts in the sprite in the Y axis of the image. |
Classes
- SpriteMaterial
Members
frameRate :number
- Description:
- The maximum frames for each given action.
- Source:
The maximum frames for each given action.
Type:
height :number
- Description:
- The height of the sprite..
- Source:
The height of the sprite..
Type:
img :HTMLImageElement
- Source:
Type:
width :number
- Description:
- Source:
The width of the sprite.
Type:
Methods
setAction(index)
- Description:
- Sets a given action to be rendered
- Source:
Parameters:
Name |
Type |
Description |
index |
number
|
|
setMaxFrames(action, max)
- Description:
- Sets max number of frames for a given action
- Source:
Parameters:
Name |
Type |
Description |
action |
number
|
|
max |
number
|
|
setup(frames, actions)
- Source:
Parameters:
Name |
Type |
Description |
frames |
number
|
|
actions |
number
|
|