Possibility of Pop-Ups?

Recently i have begun working on an app where you have to get something from point A to point B without it falling off the screen. I was wondering if there was a way for when the player wins that it makes a pop-up that says like “Yay you won!” and has a retry button, a next button, and a level select button. I am using the director class, because i am more familair with it and if i were to make separate screens with that information instead of like a popup i would have over 40 scenes.

Thank You. [import]uid: 69054 topic_id: 19859 reply_id: 319859[/import]

Director supports a “popup” mode. [import]uid: 19626 topic_id: 19859 reply_id: 77087[/import]

Do you know where I could go to find how to make it? [import]uid: 69054 topic_id: 19859 reply_id: 77101[/import]

Its the 3rd example file. The menu calls screen3.lua (or whatever it’s called). You can pull the code directly out of the director samples.

but its basically:
director:openPopUp({optional=params}, scene, onCloseCallBack)

then in the popup scene you call:

director:closePopUp()

[import]uid: 19626 topic_id: 19859 reply_id: 77110[/import]

OK thank you. The only issue i found was that your not able to call a changeScene function in the popup, so i’m just going to make separate scenes.

Thanks. [import]uid: 69054 topic_id: 19859 reply_id: 77122[/import]

You could also just make a function with a popup like this:

[lua]local function popupfunction()
popup = display.newImage(“popupimagelikearect.png”)
localGroup:insert(popup)
YouWin = display.newText(…whatever)
localGroup:insert(YouWin)
local function exitPopup()
popup:removeSelf()
YouWin:removeSelf(()
end
popup:addEventListener(“touch”, exitPopup)
end[/lua]

Hope this helps,

Regards,
Jordan Schuetz
Ninja Pig Studios [import]uid: 29181 topic_id: 19859 reply_id: 77173[/import]

Remember when using a popup of your own making to set focus if it is over anything else than could be accidentally pressed.

Peach :wink: [import]uid: 52491 topic_id: 19859 reply_id: 77217[/import]