The bigger problem I am having today is about doing a fade out between scenes.
My default collection (called “loader”) has a black image that fills the screen. It becomes opaque just before a new scene is loaded, and then fades out once the proxy loaded message is received. It works perfectly in all my scenes. However, in my levels, I have an object (called “tile”) that has this in the init:
function init(self)
local p= go.get_position()
local oddeven= ((p.y+p.x)/100)%2 --sets to 1 or 0 to change tile colour
go.set("#sprite", "tint.w", oddeven) -- sets tile colour to A or B (a checkerboard effec)
local objp= go.get_position()
p.y = p.y-500 -- sets start point for sliding up
go.set_position(p) -- goes to start point before sliding up
local time=((p.x*4)+(1400-(p.y*4)))/5000
go.animate(".", "position", go.PLAYBACK_ONCE_FORWARD, objp, go.EASING_OUTBACK, time) --slides up
end
This object jumps forward to the top of the Z layer for a tiny split second (over the top of the black image). However, if i print the z layer from the init, it is always 0.
If I remove the above script, the problem does not happen.
I believe someone else had a similar problem some time ago, but I can’t find that thread. If anyone can help or find that thread, please let me know.