UI across all scenes

Hello again
i have a question about User Interface feature

How can i make mu UI(that stores in myui.lua or something) to span across all scenes(using director) and to be on top of other display objects?

hope it makes sense, any help is appreciated

nevermind, i solved it myself) just needed to call function after defining background

Can you post some sample code? I feel I'm doing the same thing but in a very bad way.

yeah, why not...
this is ui.lua

1
2
3
4
5
6
7
8
9
module(...,package.seeall)
 
function bla()
local tabGroup = display.newGroup()
tabGroup.x = display.contentWidth/2 - 150
tabGroup.y = display.contentHeight-100
 
return true
end

Your experimentation came up with the "correct" answer. Which is always cool when it happens. :)

The thing about Director that a lot of people never think about is that it isn't "magic" -- it just seems like it sometimes. :)

In a nutshell what happens is that you build everything on a screen and then pass that to Director, which takes care of displaying it to the user.

So whether you want toolbars that always show the same way, or a little floating widget that spans screens, you just create it the same way you would for a single screen -- Director just handles the details of ditching the old screen and showing the new one.

Jay

views:1567 update:2011/9/26 8:07:09
corona forums © 2003-2011