


For example, an image with dimensions of 100x200 becomes a texture with dimensions of 128x256 in memory. Gideros automatically increase the texture size to conform to this rule. To use an image as a texture, its width and height always have to be a power of two. Texture atlases usually consume less memory. There are two main reasons for using a texture atlas instead of many independent textures:ġ. When Gideros starts, the display list hierarchy contains one item (the global Stage instance) only and we can add more: You can access this global variable with the name stage. The root of the scene tree is an instance of the Stage class which is automatically created and set as a global variable when Gideros starts. The scene tree is the hierarchy of all graphical objects currently displayed and this hierarchy needs a root. Therefore if you add a child object that already has a different sprite as a parent, the sprite is removed from the child list of the other sprite and then added to this sprite. new () - Add the new Sprite as a child : mySprite : addChild ( childSprite ) - Set the position : mySprite : setPosition ( 10, 20 ) - Set the scaling : mySprite : setScale ( 0.5, 1 ) - Set the rotation angle : mySprite : setRotation ( 90 ) - Set the alpha transparency : mySprite : setAlpha ( 0.7 ) - Get the first child : mySprite : getChildAt ( 1 ) - Remove the child : mySprite : removeChild ( childSprite ) Create a new Sprite instance : local childSprite = Sprite. Hierarchy is an important feature in graphics - when you move your parent sprite, all the child (and grandchild) sprites also move simultaneously. Sprites can have other sprites as their children and these children inherit properties such as position, scaling, and transparency from their parent sprite. It’s the main construction element and used to create display hierarchies. Sprite is the base class of all display classes and has no visual representation. Sprite class is used to group and transform these instances. For example, the Bitmap class is used to display bitmap graphics, and TextField is used to display text object. In Gideros Studio, all graphical content is constructed by creating graphical instances and adding them to the scene tree. Graphics and animation Introduction to graphics 5.3 Getting Texture Regions from Texture Packs.5.2.1 Dynamic Creation of Texture Packs.
