Difference between revisions of "Sprite"
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
<!-- GIDEROSOBJ:Sprite --> | <!-- GIDEROSOBJ:Sprite --> | ||
− | '''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]]<br/> | + | '''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/> |
'''<translate>Available since</translate>:''' Gideros 2011.6<br/> | '''<translate>Available since</translate>:''' Gideros 2011.6<br/> | ||
'''<translate>Inherits from</translate>:''' [[Special:MyLanguage/EventDispatcher|EventDispatcher]]<br/> | '''<translate>Inherits from</translate>:''' [[Special:MyLanguage/EventDispatcher|EventDispatcher]]<br/> | ||
Line 29: | Line 29: | ||
[[Special:MyLanguage/Sprite:getColorTransform|Sprite:getColorTransform]] ''<translate>returns the red, green, blue and alpha channel multipliers</translate>''<br/><!-- GIDEROSMTD:Sprite:getColorTransform --> | [[Special:MyLanguage/Sprite:getColorTransform|Sprite:getColorTransform]] ''<translate>returns the red, green, blue and alpha channel multipliers</translate>''<br/><!-- GIDEROSMTD:Sprite:getColorTransform --> | ||
[[Special:MyLanguage/Sprite:getHeight|Sprite:getHeight]] ''<translate>returns the height</translate>''<br/><!-- GIDEROSMTD:Sprite:getHeight --> | [[Special:MyLanguage/Sprite:getHeight|Sprite:getHeight]] ''<translate>returns the height</translate>''<br/><!-- GIDEROSMTD:Sprite:getHeight --> | ||
+ | [[Special:MyLanguage/Sprite:getLayoutConstraints|Sprite:getLayoutConstraints]] ''<translate>get the current layout constraints</translate>''<br/><!-- GIDEROSMTD:Sprite:getLayoutConstraints --> | ||
+ | [[Special:MyLanguage/Sprite:getLayoutInfo|Sprite:getLayoutInfo]] ''<translate>get information of the current layout</translate>''<br/><!-- GIDEROSMTD:Sprite:getLayoutInfo --> | ||
+ | [[Special:MyLanguage/Sprite:getLayoutParameters|Sprite:getLayoutParameters]] ''<translate>get the current layout parameters</translate>''<br/><!-- GIDEROSMTD:Sprite:getLayoutParameters --> | ||
[[Special:MyLanguage/Sprite:getMatrix|Sprite:getMatrix]] ''<translate>returns the transformation matrix of the sprite</translate>''<br/><!-- GIDEROSMTD:Sprite:getMatrix --> | [[Special:MyLanguage/Sprite:getMatrix|Sprite:getMatrix]] ''<translate>returns the transformation matrix of the sprite</translate>''<br/><!-- GIDEROSMTD:Sprite:getMatrix --> | ||
[[Special:MyLanguage/Sprite:getNumChildren|Sprite:getNumChildren]] ''<translate>returns the number of children of this sprite</translate>''<br/><!-- GIDEROSMTD:Sprite:getNumChildren --> | [[Special:MyLanguage/Sprite:getNumChildren|Sprite:getNumChildren]] ''<translate>returns the number of children of this sprite</translate>''<br/><!-- GIDEROSMTD:Sprite:getNumChildren --> | ||
Line 60: | Line 63: | ||
[[Special:MyLanguage/Sprite:setClip|Sprite:setClip]] ''<translate>Clip Sprite contents</translate>''<br/><!-- GIDEROSMTD:Sprite:setClip --> | [[Special:MyLanguage/Sprite:setClip|Sprite:setClip]] ''<translate>Clip Sprite contents</translate>''<br/><!-- GIDEROSMTD:Sprite:setClip --> | ||
[[Special:MyLanguage/Sprite:setColorTransform|Sprite:setColorTransform]] ''<translate>sets the red, green, blue and alpha channel multipliers</translate>''<br/><!-- GIDEROSMTD:Sprite:setColorTransform --> | [[Special:MyLanguage/Sprite:setColorTransform|Sprite:setColorTransform]] ''<translate>sets the red, green, blue and alpha channel multipliers</translate>''<br/><!-- GIDEROSMTD:Sprite:setColorTransform --> | ||
+ | [[Special:MyLanguage/Sprite:setLayoutConstraints|Sprite:setLayoutConstraints]] ''<translate>specify the child placement constraints for Gideros's layout system</translate>''<br/><!-- GIDEROSMTD:Sprite:setLayoutConstraints --> | ||
+ | [[Special:MyLanguage/Sprite:setLayoutParameters|Sprite:setLayoutParameters]] ''<translate>specify the parent parameters for Gideros's layout system</translate>''<br/><!-- GIDEROSMTD:Sprite:setLayoutParameters --> | ||
[[Special:MyLanguage/Sprite:setMatrix|Sprite:setMatrix]] ''<translate>sets the transformation matrix of the sprite</translate>''<br/><!-- GIDEROSMTD:Sprite:setMatrix --> | [[Special:MyLanguage/Sprite:setMatrix|Sprite:setMatrix]] ''<translate>sets the transformation matrix of the sprite</translate>''<br/><!-- GIDEROSMTD:Sprite:setMatrix --> | ||
[[Special:MyLanguage/Sprite:setPosition|Sprite:setPosition]] ''<translate>sets the x,y and z coordinates of the sprite</translate>''<br/><!-- GIDEROSMTD:Sprite:setPosition --> | [[Special:MyLanguage/Sprite:setPosition|Sprite:setPosition]] ''<translate>sets the x,y and z coordinates of the sprite</translate>''<br/><!-- GIDEROSMTD:Sprite:setPosition --> |
Revision as of 16:41, 31 August 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 |