Trees | Indices | Toggle frames |
---|
Sprites allows to display a image in a rectangular area, which can be rotated, scaled and moved. The placement in the scene follows the standard CocosNode rules. Also, all stock actions will work with sprites.
Animation as in cartoon style animation, that is, replacing the image fast enough to give the illusion of movement, can be accomplished by:
- using an animated .gif file as source for the image
- passing a pyglet.image.Animation as image, which collects a number of images
- have an array of images and let your code assign to the sprite image member
To execute any action you need to create an action:
move = MoveBy( (50,0), 5 )
In this case, move is an action that will move the sprite 50 pixels to the right (x coordinate) and 0 pixel in the y coordinate in 5 seconds.
And now tell the sprite to execute it:
sprite.do( move )
Sprite
A CocosNode that displays a rectangular image.
|
Trees | Indices | Toggle frames |
---|
Generated by Epydoc 3.0beta1 on Wed Oct 26 10:00:12 2011 | http://epydoc.sourceforge.net |