Class punx.Sprite
Defined in: punx.dist.js.
Constructor Attributes | Constructor Name and Description |
---|---|
punx.Sprite(args)
A screen object.
|
Field Attributes | Field Name and Description |
---|---|
Sprite's crop height in the sprite sheet.
|
|
Sprite sheet to draw from.
|
|
Sprite's crop width in the sprite sheet.
|
|
Sprite's X crop offset in the sprite sheet.
|
|
Sprite's Y crop offset in the sprite sheet.
|
Method Attributes | Method Name and Description |
---|---|
draw(ctx, x, y, w, h)
Sprite draws itself to the context and position supplied.
|
Class Detail
punx.Sprite(args)
A screen object.
- Parameters:
- {object} args
- Construction values for public properties.
Field Detail
{int}
h
Sprite's crop height in the sprite sheet.
{Image}
sheet
Sprite sheet to draw from.
{int}
w
Sprite's crop width in the sprite sheet.
{int}
x
Sprite's X crop offset in the sprite sheet.
{int}
y
Sprite's Y crop offset in the sprite sheet.
Method Detail
draw(ctx, x, y, w, h)
Sprite draws itself to the context and position supplied.
If the sheet isn't set, a red rectangle is drawn.
- Parameters:
- ctx
- Canvas context.
- x
- y
- w
- h