Hi guys,
Having a day here with this, hopefully with this someone can help.
I have an overlay that gets called at the beginning of the game, just main menu buttons.
When you press play button, I call storyboard.hideOverlay(“fade”, 1000 ) and start the main game.
When game ends, I call the overlay. Here’s where the problem is, immediately after beginning the overlay, it triggers the overlayEnded listener, then it all goes to crap.
Any ideas?
Thanks!
K
[import]uid: 142918 topic_id: 33730 reply_id: 333730[/import]
I was able to nail down where the snag is. When you call transition.to, and onComplete call a function, that contains showOverlay it will immediately call overlayEnded, and then overlayBegan.
This is the code that creates the issue, unless there is something here I don’t understand, this is a bug.
[lua]function endGame()
storyboard.showOverlay( “menu” )
end
– door animations
function doorsClose()
local function turnLock()
transition.to(doorStage.doorLockGem_Img, {time=2000, alpha=1, rotation=0, xScale=1, yScale=1, transition=easingx.easeOutBounce, onComplete=endGame})
end
turnLock()
end
doorsClose()
I was able to nail down where the snag is. When you call transition.to, and onComplete call a function, that contains showOverlay it will immediately call overlayEnded, and then overlayBegan.
This is the code that creates the issue, unless there is something here I don’t understand, this is a bug.
[lua]function endGame()
storyboard.showOverlay( “menu” )
end
– door animations
function doorsClose()
local function turnLock()
transition.to(doorStage.doorLockGem_Img, {time=2000, alpha=1, rotation=0, xScale=1, yScale=1, transition=easingx.easeOutBounce, onComplete=endGame})
end
turnLock()
end
doorsClose()
I currently facing same issue. Still confusing.
But I have one clue that may be a key to solve this. I find out that storyboard.showOverlay() is called TWICE, so the second overlay causing overlayEnded of first overlay.
–
algazel, newbie lua programmer
sorry for my bad english
hey, I have resolved my problem!
In my case, the overlay scene is called after I click a button. I used “onEvent” listener for the button, that causing showOverlay() is called more than once because of “began”, “moved”, or “ended” phase.
When i use “onRelease” instead of “onEvent” listener, there’s no more error.
–
algazel, newbie lua programmer
sorry for my bad english
I currently facing same issue. Still confusing.
But I have one clue that may be a key to solve this. I find out that storyboard.showOverlay() is called TWICE, so the second overlay causing overlayEnded of first overlay.
–
algazel, newbie lua programmer
sorry for my bad english
hey, I have resolved my problem!
In my case, the overlay scene is called after I click a button. I used “onEvent” listener for the button, that causing showOverlay() is called more than once because of “began”, “moved”, or “ended” phase.
When i use “onRelease” instead of “onEvent” listener, there’s no more error.
–
algazel, newbie lua programmer
sorry for my bad english