Class punx.Screen
Defined in: punx.dist.js.
Constructor Attributes | Constructor Name and Description |
---|---|
punx.Screen(args)
Represents a collection of sprites to be drawn to the canvas.
|
Field Attributes | Field Name and Description |
---|---|
Stage back.
|
|
List of {punx.Entity} instances.
|
|
Stage front.
|
|
Camera tracking X offset.
|
Method Attributes | Method Name and Description |
---|---|
draw()
Draws only if updated.
|
|
move(a, x, y)
|
|
update()
Update all sprites and remember if updated.
|
Class Detail
punx.Screen(args)
Represents a collection of sprites to be drawn to the canvas. Only the active screen is drawn.
- Parameters:
- {object} args
- Construction values for public properties.
Field Detail
back
Stage back.
{Punx.Sprites[]}
bgs
List of {punx.Entity} instances. Should be pre-sorted by the draw order (z-index).
- Default Value:
- []
front
Stage front.
track
Camera tracking X offset.
Method Detail
draw()
Draws only if updated.
Draws all entities in order.
move(a, x, y)
- Parameters:
- a
- x
- y
update()
Update all sprites and remember if updated.
Called by the {Punx} update loop.