 |
Sprite
Sprites are the visual objects of the scene.
Each sprite possesses its own canvas object.
The canvas is where the actual geometry is generated and stored.
Sprites can be translated, rotated and scaled.
This affects where and how their canvas is displayed within the scene.
Properties
- number alpha
Alpha modifier value
- Canvas canvas
Canvas of the sprite
- Color color
Color tint modifier
- number depth
Z-ordering of the sprite. Sprites with greater depth are rendered first
- number rotation
Rotation of the sprite in degrees
- number scalex
Horizontal scaling of the sprite
- number scaley
Vertical scaling of the sprite
- bool visible
Includes or excludes the sprite from being rendered
- number x
X-location of the sprite in parent coordinates
- number y
Y-location of the sprite in parent coordinates
Constructors
- Sprite ( )
- Sprite ( Point pt )
Sprite ( number x, number y )
Creates a new sprite object at a specified position in world coordinates
Non-Constant Methods
- change_position ( Point pt )
change_position ( number x, number y )
Translates the sprite by a given amount
- change_rotation ( number degres )
Rotates the sprite around its origin by a given amount in degrees
- change_rotation_r ( number radians )
Rotates the sprite around its origin by a given amount in radians
- change_scale ( number x, number y )
Scales the sprite by a given amount
- change_scalex ( number x )
Scales the sprite horizontally by a given amount
- change_scaley ( number y )
Scales the sprite vertically by a given amount
- set_position ( Point pt )
set_position ( number x, number y )
Translates the sprite to an explicit location
- set_scale ( number x, number y )
Scales the sprite to explicit proportions
|