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?
Comments
Maybe some code could help us understand?
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