Difference between revisions of "Sprite"
Line 60: | Line 60: | ||
[[Sprite:isVisible]] ''returns the visibility of sprite''<br/><!-- GIDEROSMTD:Sprite:isVisible() returns the visibility of sprite --> | [[Sprite:isVisible]] ''returns the visibility of sprite''<br/><!-- GIDEROSMTD:Sprite:isVisible() returns the visibility of sprite --> | ||
[[Sprite:localToGlobal]] ''converts the x,y coordinates from the sprite's (local) coordinates to the global coordinates''<br/><!-- GIDEROSMTD:Sprite:localToGlobal(x,y) converts the x,y coordinates from the sprite's (local) coordinates to the global coordinates --> | [[Sprite:localToGlobal]] ''converts the x,y coordinates from the sprite's (local) coordinates to the global coordinates''<br/><!-- GIDEROSMTD:Sprite:localToGlobal(x,y) converts the x,y coordinates from the sprite's (local) coordinates to the global coordinates --> | ||
+ | [[Sprite:redrawEffects]] ''tell Gideros to that effects must be recomputed''<br/><!-- GIDEROSMTD:Sprite:redrawEffects() tell Gideros to that effects must be recomputed --> | ||
[[Sprite:removeChild]] ''removes the child sprite''<br/><!-- GIDEROSMTD:Sprite:removeChild(child) removes the child sprite --> | [[Sprite:removeChild]] ''removes the child sprite''<br/><!-- GIDEROSMTD:Sprite:removeChild(child) removes the child sprite --> | ||
[[Sprite:removeChildAt]] ''removes the child sprite at the specifed index''<br/><!-- GIDEROSMTD:Sprite:removeChildAt(index) removes the child sprite at the specifed index --> | [[Sprite:removeChildAt]] ''removes the child sprite at the specifed index''<br/><!-- GIDEROSMTD:Sprite:removeChildAt(index) removes the child sprite at the specifed index --> | ||
Line 69: | Line 70: | ||
[[Sprite:setClip]] ''Clip Sprite contents''<br/><!-- GIDEROSMTD:Sprite:setClip(x,y,width,height) Clip Sprite contents --> | [[Sprite:setClip]] ''Clip Sprite contents''<br/><!-- GIDEROSMTD:Sprite:setClip(x,y,width,height) Clip Sprite contents --> | ||
[[Sprite:setColorTransform]] ''sets the red, green, blue and alpha channel multipliers''<br/><!-- GIDEROSMTD:Sprite:setColorTransform(redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier) sets the red, green, blue and alpha channel multipliers --> | [[Sprite:setColorTransform]] ''sets the red, green, blue and alpha channel multipliers''<br/><!-- GIDEROSMTD:Sprite:setColorTransform(redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier) sets the red, green, blue and alpha channel multipliers --> | ||
+ | [[Sprite:setEffectConstant]] ''Change the value of a constant in the effect stack''<br/><!-- GIDEROSMTD:Sprite:setEffectConstant(effectIndex,uniform name,data type,mult,data,program,variant) Change the value of a constant in the effect stack --> | ||
+ | [[Sprite:setEffectStack]] ''Associate an effect stack to this sprite''<br/><!-- GIDEROSMTD:Sprite:setEffectStack(effectStack,mode) Associate an effect stack to this sprite --> | ||
[[Sprite:setLayoutConstraints]] ''specify the child placement constraints for Gideros's layout system''<br/><!-- GIDEROSMTD:Sprite:setLayoutConstraints(constraints) specify the child placement constraints for Gideros's layout system --> | [[Sprite:setLayoutConstraints]] ''specify the child placement constraints for Gideros's layout system''<br/><!-- GIDEROSMTD:Sprite:setLayoutConstraints(constraints) specify the child placement constraints for Gideros's layout system --> | ||
[[Sprite:setLayoutParameters]] ''specify the parent parameters for Gideros's layout system''<br/><!-- GIDEROSMTD:Sprite:setLayoutParameters(layout) specify the parent parameters for Gideros's layout system --> | [[Sprite:setLayoutParameters]] ''specify the parent parameters for Gideros's layout system''<br/><!-- GIDEROSMTD:Sprite:setLayoutParameters(layout) specify the parent parameters for Gideros's layout system --> | ||
Line 81: | Line 84: | ||
[[Sprite:setScaleZ]] ''Set scale on z axis''<br/><!-- GIDEROSMTD:Sprite:setScaleZ(scale) Set scale on z axis --> | [[Sprite:setScaleZ]] ''Set scale on z axis''<br/><!-- GIDEROSMTD:Sprite:setScaleZ(scale) Set scale on z axis --> | ||
[[Sprite:setShader]] ''Set shader for this sprite''<br/><!-- GIDEROSMTD:Sprite:setShader(shader) Set shader for this sprite --> | [[Sprite:setShader]] ''Set shader for this sprite''<br/><!-- GIDEROSMTD:Sprite:setShader(shader) Set shader for this sprite --> | ||
− | [[Sprite:setShaderConstant]] ''Change the value of a uniform for this sprite''<br/><!-- GIDEROSMTD:Sprite:setShaderConstant(uniform name,data type,mult,data) Change the value of a uniform for this sprite --> | + | [[Sprite:setShaderConstant]] ''Change the value of a uniform for this sprite''<br/><!-- GIDEROSMTD:Sprite:setShaderConstant(uniform name,data type,mult,data,program,variant) Change the value of a uniform for this sprite --> |
[[Sprite:setSkew]] <br/><!-- GIDEROSMTD:Sprite:setSkew(kx,ky) --> | [[Sprite:setSkew]] <br/><!-- GIDEROSMTD:Sprite:setSkew(kx,ky) --> | ||
[[Sprite:setSkewX]] <br/><!-- GIDEROSMTD:Sprite:setSkewX(kx) --> | [[Sprite:setSkewX]] <br/><!-- GIDEROSMTD:Sprite:setSkewX(kx) --> | ||
Line 95: | Line 98: | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
+ | |||
=== Events === | === Events === | ||
[[Event.ADDED_TO_STAGE]]<br/><!-- GIDEROSEVT:Event.ADDED_TO_STAGE addedToStage--> | [[Event.ADDED_TO_STAGE]]<br/><!-- GIDEROSEVT:Event.ADDED_TO_STAGE addedToStage--> |
Revision as of 08:54, 18 December 2020
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 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 |