Difference between revisions of "Sprite"
(→Events) |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 12: | Line 12: | ||
The drawing order is defined by the order of children. The first child is drawn first and the last child is drawn last. It is possible to change the drawing order by modifying the order of child list. | The drawing order is defined by the order of children. The first child is drawn first and the last child is drawn last. It is possible to change the drawing order by modifying the order of child list. | ||
− | A Sprite instance can exist without attaching the scene tree. | + | A Sprite instance can exist without attaching it to 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. | 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. | ||
Line 76: | Line 76: | ||
[[Sprite:setEffectConstant]] ''changes the value of a constant in the effect stack''<br/><!--GIDEROSMTD:Sprite:setEffectConstant(effectIndex,uniform name,data type,mult,data,program,variant) changes the value of a constant in the effect stack--> | [[Sprite:setEffectConstant]] ''changes the value of a constant in the effect stack''<br/><!--GIDEROSMTD:Sprite:setEffectConstant(effectIndex,uniform name,data type,mult,data,program,variant) changes the value of a constant in the effect stack--> | ||
[[Sprite:setEffectStack]] ''associates an effect stack to this sprite''<br/><!--GIDEROSMTD:Sprite:setEffectStack(effectStack,mode) associates an effect stack to this sprite--> | [[Sprite:setEffectStack]] ''associates an effect stack to this sprite''<br/><!--GIDEROSMTD:Sprite:setEffectStack(effectStack,mode) associates an effect stack to this sprite--> | ||
+ | [[Sprite:setGhosts]] ''renders original Sprite with slight variations''<br/><!--GIDEROSMTD:Sprite:setGhosts(table) renders original Sprite with slight variations--> | ||
[[Sprite:setLayoutConstraints]] ''specifies the child placement constraints for Gideros layout system''<br/><!--GIDEROSMTD:Sprite:setLayoutConstraints(constraints) specifies the child placement constraints for Gideros layout system--> | [[Sprite:setLayoutConstraints]] ''specifies the child placement constraints for Gideros layout system''<br/><!--GIDEROSMTD:Sprite:setLayoutConstraints(constraints) specifies the child placement constraints for Gideros layout system--> | ||
[[Sprite:setLayoutParameters]] ''specifies the parent parameters for Gideros layout system''<br/><!--GIDEROSMTD:Sprite:setLayoutParameters(layout) specifies the parent parameters for Gideros layout system--> | [[Sprite:setLayoutParameters]] ''specifies the parent parameters for Gideros layout system''<br/><!--GIDEROSMTD:Sprite:setLayoutParameters(layout) specifies the parent parameters for Gideros layout system--> | ||
Line 127: | Line 128: | ||
[[Sprite.ADD]]<br/><!--GIDEROSCST:Sprite.ADD add--> | [[Sprite.ADD]]<br/><!--GIDEROSCST:Sprite.ADD add--> | ||
[[Sprite.ALPHA]]<br/><!--GIDEROSCST:Sprite.ALPHA alpha--> | [[Sprite.ALPHA]]<br/><!--GIDEROSCST:Sprite.ALPHA alpha--> | ||
− | [[Sprite.EFFECT_MODE_AUTOMATIC]] '' | + | [[Sprite.EFFECT_MODE_AUTOMATIC]] ''Update effects automatic''<br/><!--GIDEROSCST:Sprite.EFFECT_MODE_AUTOMATIC 1--> |
− | [[Sprite.EFFECT_MODE_CONTINUOUS]] ''Always update the effects | + | [[Sprite.EFFECT_MODE_CONTINUOUS]] ''Always update the effects '''default'''''<br/><!--GIDEROSCST:Sprite.EFFECT_MODE_CONTINUOUS 0--> |
[[Sprite.EFFECT_MODE_TRIGGERED]] ''Update effects on demand''<br/><!--GIDEROSCST:Sprite.EFFECT_MODE_TRIGGERED 2--> | [[Sprite.EFFECT_MODE_TRIGGERED]] ''Update effects on demand''<br/><!--GIDEROSCST:Sprite.EFFECT_MODE_TRIGGERED 2--> | ||
[[Sprite.LAYOUT_ANCHOR_CENTER]]<br/><!--GIDEROSCST:Sprite.LAYOUT_ANCHOR_CENTER 0--> | [[Sprite.LAYOUT_ANCHOR_CENTER]]<br/><!--GIDEROSCST:Sprite.LAYOUT_ANCHOR_CENTER 0--> |
Latest revision as of 00:22, 7 October 2024
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, propagate its effect to all of its children.
The drawing order is defined by the order of children. The first child is drawn first and the last child is drawn last. It is possible to change the drawing order by modifying the order of child list.
A Sprite instance can exist without attaching it to 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 |