I would like to display fps and texture memory usage independently of my scene manager, on top of everything. Is such a layer/Sprite available in Gideros?
Just add a sprite to stage after you have added the SceneManager - or before if you want Scene Manager above the game.
I use scene manager whilst the game is running underneath on stuff I'm writing now - this way it looks more like a traditional arcade game - the game self-plays underneath in demo mode whilst the player picks his options/starts the game for real.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Also we could use some overriding hackery (also known as witchcraft) Which would work also if you add elements tot he stage without sceneManager. as you want it always to be on top, we would want it to add to stage, so let's override stage addChild method to look for a "superLayer"
stage.__addChild = Sprite.addChild
function stage:addChild(child)print("adding child")if stage.__superLayer and stage:contains(stage.__superLayer)thenlocal ind = stage:getChildIndex(stage.__superLayer)
stage:addChildAt(child, ind)else
stage:__addChild(child)endend
then just for test, let's create a red text and set it as superLayer
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Comments
I use scene manager whilst the game is running underneath on stuff I'm writing now - this way it looks more like a traditional arcade game - the game self-plays underneath in demo mode whilst the player picks his options/starts the game for real.
https://deluxepixel.com
Which would work also if you add elements tot he stage without sceneManager.
as you want it always to be on top, we would want it to add to stage, so let's override stage addChild method to look for a "superLayer"
Wow, red text is still on the blue text, although we added blue text after red text, what a sorcery
Likes: SinisterSoft, duke2017
https://deluxepixel.com
thanks, I wanted to check if it was already available before adding yet another Sprite on top.
This _superLayer implementation is interesting