Hi
I have been going thru the Documentation of the API and as a NEW user of LUA I find that the documentation is incomplete.
For instance in one of the samples you have this line:
stage:addChild(Bitmap.new(Texture.new("cloud_backgroundiPad.png")))
Now for an iPhone and iPad the size of the displayed area will depend on the dimensions of the PNG. So if the PNG is 1024x768 then the app is for iPad and will not display correctly on the iPhone.
The documentation displays only 2 items for stage:
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
Stage:setOrientation
Stage:getOrientation
No where is it mentioned about stage:addChild
So where can I get complete documentation about this? Corona SDK also uses LUA but they use a different call:
Display
I have searched in Google but cannot find anything , Is stage specific to your API or is it generic to LUA and where can I find out more info about this?
I feel this is important because this "stage" is what the user sees and is the basic top level object/class.
Also If I want to make a universal app how can I find out if this is an iPad or iPhone and so change the background image to give the correct display size?
Thanks
Comments
State class is inherited from Sprite class. Therefore, it contains all the functions that Sprite class has. When you look at the documentation of Stage, you see the title "Stage > Sprite". It's not clear but it means Stage class is inherited from Sprite class.
Universal apps are on the way. Currently, you should develop two different version for iPhone and iPad.
Thank you.
Thanks for clearing that up. I have to take your word for it because looking at the documentation I do not see anywhere "Stage> Sprite".
I see this in the page http://giderosmobile.com/documentation/reference_manual.html:
Sprite
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.
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.
It is not clear at all which inherits from which from reading the API documentation.
Can you point me to where in the documentation it says that Stage inherits from Sprite?
And thanks for your quick replies.
I've updated the link on the wiki. The correct reference manual link is:
http://giderosmobile.com/documentation/reference_manual_2011.9.html
The inheritance relation between classes should be clear in the documentation. Thank you for the feedback.
So based on the new link the hierarchy is
EventDispatcher > Sprite > Stage, Bitmap, Shape etc.
Hope that is correct?