Difference between revisions of "Stage"

From GiderosMobile
(removed language stuff)
Line 6: Line 6:
  
 
=== Description ===
 
=== Description ===
The '''Stage''' class represents the top of the scene tree hierarchy. The instances of '''Stage''' is not created directly (there is not any ''Stage.new'' function) but there is already a global variable ''stage''.
+
The '''Stage''' class represents the top of the scene tree hierarchy. The instances of '''Stage''' is not created directly (there is not any ''Stage.new'' function) but there is already a global variable '''''stage'''''.
 +
 
 +
=== Example ===
 +
'''We won't see the pixel until we add it to ''stage'''''
 +
<source lang="lua">
 +
local pixel = Pixel.new(0xff00ff, 1, 64, 64)
 +
pixel:setPosition(16, 16)
 +
stage:addChild(pixel)
 +
</source>
  
 
{|-
 
{|-

Revision as of 03:02, 10 May 2022

Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.pngPlatform html5.pngPlatform winrt.pngPlatform win32.png
Available since: Gideros 2011.6
Inherits from: Sprite

Description

The Stage class represents the top of the scene tree hierarchy. The instances of Stage is not created directly (there is not any Stage.new function) but there is already a global variable stage.

Example

We won't see the pixel until we add it to stage

local pixel = Pixel.new(0xff00ff, 1, 64, 64)
pixel:setPosition(16, 16)
stage:addChild(pixel)

Methods

Stage:setClearColorBuffer enables/disables draw call for background color

Events

Constants