Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
How To Use BhWaxSceneDemo Project? — Gideros Forum

How To Use BhWaxSceneDemo Project?

ljp1203ljp1203 Member
edited November 2012 in General questions
Hi all!

I need some help with a project made by @bowerandy .

I am using SceneManager by @atlim and Wax by @bowerandy . I wanted to use the BhWaxSceneDemo with my GiderosiOSPlayer. I added all of the files to my Player and it all works fine. Now what I want to do is use elements like date pickers, textfields, etc. that go by the rules of SceneManager.

Now I looked at BhWaxSceneDemo on https://github.com/bowerhaus/BhWax/blob/master/BhWaxSceneDemo.lua

I thought all you had to do was add the name of the LUA file like it shows in the project to allow elements of Wax to be incorporated with SceneManager.

Ex.
function DemoScene1:onButtonClicked()
	BhWaxSceneDemo.sharedInstance.sceneManager:changeScene("scene2", 1, SceneManager.moveFromRight)
end
BhWaxSceneDemo is the name of the LUA file so I thought that all you had to add before sharedInstance was the name of the file. But that wasn't it.

Hopefully this all makes sense.

So I'm kind of stuck in the mud right now, and help would be appreciated.

Thanks!
-Landon
JLS
Lead Coder and Designer

Comments

  • bowerandybowerandy Guru
    Accepted Answer
    @ljp1203, if you look in BhWaxSceneDemo:init() in the original file you'll see that the last line in that method saves the object being created in the "sharedInstance" variable. You'll have to do a similar thing in your code.

    best regards
  • Hi @bowerandy ,

    Thanks for the response. I have another quick question you can probably answer. :D

    I use a main.lua and other scenes shown below:
    UIApplication:sharedApplication():setStatusBarHidden_animated(false, false)
     
     
    --Background Image
    local background = Bitmap.new(Texture.new("Images/background.png"))
    stage:addChild(background)
     
    --SceneManager
    sceneManager = SceneManager.new({
    	["login"] = login,
    	["mainmenu"] = mainmenu,
    	["createEvent"] = createEvent,
    	["Party"] = Party,
    	["Vacation"] = Vacation,
    	["Other"] = Other,
    	["ViewEdit"] = ViewEdit,
    	["Settings"] = Settings,
    	["Help"] = Help,
    	["FAQ"] = FAQ,
    	["About"] = About,
    })
     
    stage:addChild(sceneManager)
     
    sceneManager:changeScene("mainmenu")

    I want to know if I have to put a :init() line in every LUA file, or just the main.lua.

    Thanks!
    -Landon
    JLS
    Lead Coder and Designer
Sign In or Register to comment.