Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
How to pass dynamic scenes? — Gideros Forum

How to pass dynamic scenes?

tugbakayatugbakaya Member
edited January 2013 in General questions
I am writing an application with dynamic scenes. ı am holding nodes and with one scene class, ı am formin the scenes. but ı want to pass this scenes pipelined. for example, scenes of rooms in a house. ı want to pass all rooms with one button. how can ı do that?
Tagged:

Comments

  • Sorry, but I didn't really understand the problem. So you can pass the values using SceneManager class, so what exactly is the problem?

    Maybe some code could help us understand? :)
  • local myscenes = {}
    function scene_maker()
    local l = self.child
    local list = self
    print("name" , self.name)
    while l do
    local holder = t.name
    local sceneManager = SceneManager.new({
    ["holder"] = holder,
    })

    table.insert(myscenes,holder)
    --stage:addChild(sceneManager)
    local transitions = {
    SceneManager.moveFromLeft,
    SceneManager.moveFromRight,
    SceneManager.moveFromBottom,
    SceneManager.moveFromTop,
    SceneManager.moveFromLeftWithFade,
    SceneManager.moveFromRightWithFade,
    SceneManager.moveFromBottomWithFade,
    SceneManager.moveFromTopWithFade,
    SceneManager.overFromLeft,
    SceneManager.overFromRight,
    SceneManager.overFromBottom,
    SceneManager.overFromTop,
    SceneManager.overFromLeftWithFade,
    SceneManager.overFromRightWithFade,
    SceneManager.overFromBottomWithFade,
    SceneManager.overFromTopWithFade,
    SceneManager.fade,
    SceneManager.crossFade,
    SceneManager.flip,
    SceneManager.flipWithFade,
    SceneManager.flipWithShade,
    }
    icon1.serviceList = l
    icon1.rootList = list
    local transition = transitions[math.random(1, 4)]
    sceneManager:changeScene("service_scene", 1, transition, easing.outQuadratic, { userData = {serviceList = l.value, rootList =list}})

    end
    end






    local currentScene = 1
    local function nextScene()
    local next = myscenes[currentScene]

    currentScene = currentScene + 1
    if currentScene > #myscenes then
    currentScene = 1
    end

    return next
    end




    local passButton = Bitmap.new(Texture.new("icons/passer.png"))
    passButton:setPosition(200,100)
    stage:addChild(passButton)


    passButton:addEventListener(Event.MOUSE_DOWN,
    function()
    sceneManager:changeScene(nextScene(), 1, SceneManager.flipWithShade, easing.inOutQuadratic)
    end)




    By this code, ı am trying the form scenes dynmically, so that by a pass button ı will pass other scene.ı am tryin to form and hold the scenes in a list but it is not working
  • twisttaptwisttap Member
    edited January 2013
    If I understand correctly, with pressing the button you want to skip to next scene ? is that correct ? If that is the case you should add each scene to:
    local sceneManager = SceneManager.new({
    ["holder"] = holder,
    ["scene1"] = scene1,
    ["scene2"] = scene2,
    ["sceneN"] = sceneN,
    })
    and also you need create a file for each scene.
Sign In or Register to comment.