| Trees | Indices | Help |
|---|
|
|
batch.cocosnode.CocosNode --+
|
batch.BatchableNode --+
|
object --+ |
| |
pyglet.event.EventDispatcher --+ |
| |
pyglet.sprite.Sprite --+
|
Sprite
A CocosNode that displays a rectangular image.
Example::
sprite = Sprite('grossini.png')
|
|||
|
supported_classes A CocosNode that displays a rectangular image. |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
Initialize the sprite
:Parameters:
`image` : string or image
name of the image resource or a pyglet image.
`position` : tuple
position of the anchor. Defaults to (0,0)
`rotation` : float
the rotation (degrees). Defaults to 0.
`scale` : float
the zoom factor. Defaults to 1.
`opacity` : int
the opacity (0=transparent, 255=opaque). Defaults to 255.
`color` : tuple
the color to colorize the child (RGB 3-tuple). Defaults to (255,255,255).
`anchor` : (float, float)
(x,y)-point from where the image will be positions, rotated and scaled in pixels. For example (image.width/2, image.height/2) is the center (default).
|
Get a cocos.rect.Rect for this sprite.
Note that this rect's position is most likely NOT the same
as the Sprite's position - in fact by default the rect's
center is the Sprite's position. If you move the rect around
and wish to reflect this change in the Sprite, you will probably
have to do something like (again with the default image anchor
in the center)::
rect = sprite.get_rect()
rect.midbottom = (0, 100)
sprite.position = rect.center
Returns a cocos.rect.Rect instance.
|
Returns a local-coordinates Axis aligned Bounding Box Returns a cocos.rect.Rect instance. |
|
|
|
|
When the sprite is not into a batch it will be draw with this method. If in a batch, this method is not called, and the draw is done by the batch.
|
updates vertex list
|
| Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Tue Mar 12 13:57:05 2013 | http://epydoc.sourceforge.net |