Is there any way to forming scene according to and object. I mean how many object ı have ı dont know. any number could be and ı want a scene that for any object, it will generate a scene which depends on its attibutes. for example many books ı have. when ı click anyone, a scene changes and form the title, a picture or something. To sum, ı am trying to find a way to send argument to scene manager.
Comments
This is possible with a modification of SceneManager by @ndoss
https://github.com/ndoss/Scene-Manager
where you can pass the data as the additional table argument:
sceneManager:changeScene("root_scene", 1, SceneManager.flipWithShade, easing.inOutQuadratic, {MyRoot = {name = MyRoot.name, MyRoot.child, MyRoot.image, MyRoot.icon, MyRoot.type, MyRoot.add_prop}})
if param ~= nil then
print(param.name)
end
function()
local transition = transitions[math.random(1, 4)]
local c = MyRoot.name
print("before sent ")
print(MyRoot.name)
sceneManager:changeScene("root_scene", 1, transition, easing.outQuadratic, { userData = {name = MyRoot.name, MyRoot.name, na = c, c, MyRoot.type, MyRoot.add_prop } } )
end)
in my class
function root_scene:init(param)
--if param ~= nil then
print("first value")
print(param.name)
print("second value")
print(param[1])
print("third value")
print(param.na)
print("forth value")
print(param[3])
end
ı am using exactly this code. but all possible values are return nil
It should start with something like:
--[[ SceneManager v1.0.4 changelog: ---------- v1.0.4 - 08.04.2012 Added option to filter a list of events during transitions Moved increment of time to end of onEnterFrame so that time goes from 0 to 1 Added additional "real time" argument to dispatched transitions Added option to pass user data to a scene when it gets created
var1 = value, var2 = value, var3 = value, etc...
In your code I see some values without a var or vice versa.
. Should ı change it?