@ETdoFresh: Thanks for the ideas. I cleaned up the code for the scene and everything looks in order, but still no luck. Oddly enough, changing the transition type works fine, but the duration is always 500 ms no matter what I set it to. Below I have it set to 5000 ms, which should be quite visually obvious.
Here’s the code to show the overlay:
[lua]storyboard.showOverlay(“rooms.main_menu”, {effect=“fade”, time=2000})[/lua]
Note that transition duration works when showing the overlay.
Here’s the entire overlay module:
[lua]-- Load storyboard and create the scene
local storyboard = require(“storyboard”)
local scene = storyboard.newScene()
– Local variables
local startButton = nil
local settingsButton = nil
– Setup function
function scene:createScene (e)
local group = self.view
– Create the menu overlay group and elements
local menuOverlay = display.newGroup()
local dogginsTitle = display.newImageRect(“images/rooms/main_menu/Menu-Title.png”, 425, 44)
settingsButton = display.newImageRect(“images/rooms/main_menu/Menu-Settings.png”, 35, 35)
– If there is a game in progress, show the “Continue Adventure” button
if (gameSettings.gameInProgress == true) then
startButton = display.newImageRect(“images/rooms/main_menu/Menu-Continue.png”, 274, 54)
startButton:setReferencePoint(display.TopLeftReferencePoint)
startButton.x = 570; startButton.y = 393
else
startButton = display.newImageRect(“images/rooms/main_menu/Menu-Start.png”, 214, 54)
startButton:setReferencePoint(display.TopLeftReferencePoint)
startButton.x = 570; startButton.y = 393
end
function startButton:touch (e)
if (e.phase == “ended”) then
if (gameSettings.gameInProgress == true) then – Continue game
storyboard.gotoScene(“rooms.” … gameState.currRoom, “fade”, 1500)
else – New game
gameSettings.gameInProgress = true
storyboard.hideOverlay(“fade”, 5000)
end
end
end
– Set reference point for overlay elements
dogginsTitle:setReferencePoint(display.TopLeftReferencePoint)
settingsButton:setReferencePoint(display.TopLeftReferencePoint)
– Reposition overlay elements
dogginsTitle.x = 460; dogginsTitle.y = 321
settingsButton.x = 970; settingsButton.y = 715
– Insert elements into the overlay group
menuOverlay:insert(dogginsTitle)
menuOverlay:insert(startButton)
menuOverlay:insert(settingsButton)
– Position the overlay
menuOverlay:setReferencePoint(display.TopLeftReferencePoint)
menuOverlay.x = 460; menuOverlay.y = 321
– Insert the overlay into the scene
group:insert(menuOverlay)
end
function scene:enterScene (e)
startButton:addEventListener(“touch”, startButton)
end
function scene:exitScene (e)
end
– Cleanup function
function scene:destroyScene (e)
end
scene:addEventListener(“createScene”, scene)
scene:addEventListener(“enterScene”, scene)
scene:addEventListener(“exitScene”, scene)
scene:addEventListener(“destroyScene”, scene)
return scene[/lua]
Thanks again for the help!
- David [import]uid: 149111 topic_id: 31512 reply_id: 125920[/import]