Hmm, the following works for me. At one point in another program I was receiving those strange warnings about “alpha outside the valid range”, and I don’t think I ever figured out why. In the following, however, I am getting no errors, and the dualFade works properly. Give it a try… it seems my dualFade transition needs a bit more work if those warnings keep coming up, but for now, this simple example works for me.
Here’s the first “scene”. You can load this however you want from main.lua, via a Director transition or whatever.
p01.lua [code]
module(…, package.seeall)
function new()
local localGroup = display.newGroup()
local function goNext()
director:changeScene( “p02”, “dualFade” )
end
local rect = display.newRect(150, 250, 200, 200)
rect:setFillColor(255,0,0)
localGroup:insert(rect)
rect:addEventListener( “tap”, goNext )
return localGroup
end
[/code]
And here’s the second scene. It gets loaded from “p01.lua” above, which fades out at the same time “p02.lua” fades in.
p02.lua [code]
module(…, package.seeall)
function new()
local localGroup = display.newGroup()
local function goNext()
director:changeScene( “p01”, “dualFade” )
end
local rect = display.newRect(200, 300, 300, 300)
rect:setFillColor(55,155,100)
localGroup:insert(rect)
rect:addEventListener( “tap”, goNext )
return localGroup
end
[/code]
Both of these scenes are hacked together quickly and would require cleaner code, for example removing the Listeners upon click. Let me know if you have any better luck.
[import]uid: 9747 topic_id: 4863 reply_id: 16052[/import]