Difference between revisions of "Sprite"
Line 2: | Line 2: | ||
'''Supported platforms:''' android, ios, mac, pc<br/> | '''Supported platforms:''' android, ios, mac, pc<br/> | ||
'''Available since:''' Gideros 2011.6<br/> | '''Available since:''' Gideros 2011.6<br/> | ||
− | === Description === | + | === <translate>Description</translate> === |
<translate><br /> | <translate><br /> | ||
The [[Special:MyLanguage/Sprite|Sprite]] class is the base class for all objects that can be placed on the scene tree. It is the basic scene tree building block.<br /> | The [[Special:MyLanguage/Sprite|Sprite]] class is the base class for all objects that can be placed on the scene tree. It is the basic scene tree building block.<br /> | ||
Line 12: | Line 12: | ||
{|- | {|- | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
− | === Methods === | + | === <translate>Methods</translate> === |
[[Special:MyLanguage/Sprite.new|Sprite.new]] ''<translate>creates a new Sprite object</translate>''<br/> | [[Special:MyLanguage/Sprite.new|Sprite.new]] ''<translate>creates a new Sprite object</translate>''<br/> | ||
[[Special:MyLanguage/Sprite:addChild|Sprite:addChild]] ''<translate>adds a sprite as a child</translate>''<br/> | [[Special:MyLanguage/Sprite:addChild|Sprite:addChild]] ''<translate>adds a sprite as a child</translate>''<br/> | ||
Line 80: | Line 80: | ||
[[Special:MyLanguage/Sprite:swapChildrenAt|Sprite:swapChildrenAt]] ''<translate>Swaps two child sprites.</translate>''<br/> | [[Special:MyLanguage/Sprite:swapChildrenAt|Sprite:swapChildrenAt]] ''<translate>Swaps two child sprites.</translate>''<br/> | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
− | === Events === | + | === <translate>Events</translate> === |
[[Special:MyLanguage/Event.ADDED_TO_STAGE|Event.ADDED_TO_STAGE]]<br/> | [[Special:MyLanguage/Event.ADDED_TO_STAGE|Event.ADDED_TO_STAGE]]<br/> | ||
[[Special:MyLanguage/Event.ENTER_FRAME|Event.ENTER_FRAME]]<br/> | [[Special:MyLanguage/Event.ENTER_FRAME|Event.ENTER_FRAME]]<br/> | ||
Line 96: | Line 96: | ||
[[Special:MyLanguage/Event.TOUCHES_END|Event.TOUCHES_END]]<br/> | [[Special:MyLanguage/Event.TOUCHES_END|Event.TOUCHES_END]]<br/> | ||
[[Special:MyLanguage/Event.TOUCHES_MOVE|Event.TOUCHES_MOVE]]<br/> | [[Special:MyLanguage/Event.TOUCHES_MOVE|Event.TOUCHES_MOVE]]<br/> | ||
− | === Constants === | + | === <translate>Constants</translate> === |
[[Special:MyLanguage/Sprite.ADD|Sprite.ADD]]<br/> | [[Special:MyLanguage/Sprite.ADD|Sprite.ADD]]<br/> | ||
[[Special:MyLanguage/Sprite.ALPHA|Sprite.ALPHA]]<br/> | [[Special:MyLanguage/Sprite.ALPHA|Sprite.ALPHA]]<br/> |
Revision as of 07:27, 24 August 2018
Supported platforms: android, ios, mac, pc
Available since: Gideros 2011.6
Description
The Sprite class is the base class for all objects that can be placed on the scene tree. It is the basic scene tree building block.
A sprite can contain child sprites which makes the scene tree hierarchy.
Transformations such as translation, rotation, scaling and color transforms propogates its effect to all of its children.
The drawing order is defined by the order of children. First child is drawn first and last child is drawn last. It is possible to change the drawing order by modifying the order of child list.
A Sprite instance can exists without attaching the scene tree.
An unattached sprite can receive Event.ENTER_FRAME event but it will only receive mouse and touch events when it is attached to the scene tree.
MethodsSprite.new creates a new Sprite object |
EventsEvent.ADDED_TO_STAGE ConstantsSprite.ADD |