Difference between revisions of "Sprite"
Line 27: | Line 27: | ||
[[Special:MyLanguage/Sprite:getChildAt|Sprite:getChildAt]] ''<translate>returns the child sprite that exists at the specified index</translate>''<br/><!-- GIDEROSMTD:Sprite:getChildAt(index) returns the child sprite that exists at the specified index --> | [[Special:MyLanguage/Sprite:getChildAt|Sprite:getChildAt]] ''<translate>returns the child sprite that exists at the specified index</translate>''<br/><!-- GIDEROSMTD:Sprite:getChildAt(index) returns the child sprite that exists at the specified index --> | ||
[[Special:MyLanguage/Sprite:getChildIndex|Sprite:getChildIndex]] ''<translate>returns the index of the specified child sprite</translate>''<br/><!-- GIDEROSMTD:Sprite:getChildIndex(child) returns the index of the specified child sprite --> | [[Special:MyLanguage/Sprite:getChildIndex|Sprite:getChildIndex]] ''<translate>returns the index of the specified child sprite</translate>''<br/><!-- GIDEROSMTD:Sprite:getChildIndex(child) returns the index of the specified child sprite --> | ||
+ | [[Special:MyLanguage/Sprite:getChildrenAtPoint|Sprite:getChildrenAtPoint]] ''<translate>returns the children sprites that corresponds to the given screen coordinates</translate>''<br/><!-- GIDEROSMTD:Sprite:getChildrenAtPoint(x,y,visible,nosubs) returns the children sprites that corresponds to the given screen coordinates --> | ||
[[Special:MyLanguage/Sprite:getClip|Sprite:getClip]] <br/><!-- GIDEROSMTD:Sprite:getClip() --> | [[Special:MyLanguage/Sprite:getClip|Sprite:getClip]] <br/><!-- GIDEROSMTD:Sprite:getClip() --> | ||
[[Special:MyLanguage/Sprite:getColorTransform|Sprite:getColorTransform]] ''<translate>returns the red, green, blue and alpha channel multipliers</translate>''<br/><!-- GIDEROSMTD:Sprite:getColorTransform() returns the red, green, blue and alpha channel multipliers --> | [[Special:MyLanguage/Sprite:getColorTransform|Sprite:getColorTransform]] ''<translate>returns the red, green, blue and alpha channel multipliers</translate>''<br/><!-- GIDEROSMTD:Sprite:getColorTransform() returns the red, green, blue and alpha channel multipliers --> | ||
Line 88: | Line 89: | ||
[[Special:MyLanguage/Sprite:swapChildrenAt|Sprite:swapChildrenAt]] ''<translate>Swaps two child sprites.</translate>''<br/><!-- GIDEROSMTD:Sprite:swapChildrenAt(index1,index2) Swaps two child sprites. --> | [[Special:MyLanguage/Sprite:swapChildrenAt|Sprite:swapChildrenAt]] ''<translate>Swaps two child sprites.</translate>''<br/><!-- GIDEROSMTD:Sprite:swapChildrenAt(index1,index2) Swaps two child sprites. --> | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
+ | |||
=== <translate>Events</translate> === | === <translate>Events</translate> === | ||
[[Special:MyLanguage/Event.ADDED_TO_STAGE|Event.ADDED_TO_STAGE]]<br/><!-- GIDEROSEVT:Event.ADDED_TO_STAGE addedToStage--> | [[Special:MyLanguage/Event.ADDED_TO_STAGE|Event.ADDED_TO_STAGE]]<br/><!-- GIDEROSEVT:Event.ADDED_TO_STAGE addedToStage--> |
Revision as of 07:47, 20 December 2018
Supported platforms:
Available since: Gideros 2011.6
Inherits from: EventDispatcher
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 |