Show a popup with image and text?

Is there any way to show a popup of a panel or something that will show an image and text in it? I have a food menu and would like to click any of them to show a popup with an image of it and the description. I guess I could create an image for the panel and when I need to show it then make it visible on the screen centered and then put the food image and description on it. Is that the best way?

I will be using this while scrolling through a menu image using the scrollView control. Do I not insert the panel image in the scrollview control so the x/y won’t be based on the scroll view but for the device? Because if I say to show the panel at 10,10 and I have scrolled down the menu image, if the panel is inserted in the scroll view then the panel will be off the screen. Am I right on this?

Thanks!

Warren

You’re basically right all around.

You don’t want to insert your pop up dialog into your scrollView. If you have an overall screen group, which the scroll view was inserted into, you’d want to insert the popup there. (if you’re not using an overall group for all the objects onscreen, you might want to consider it, it helps a lot in managing objects depth priorities.

You’ll probably want to make it a utility function, called like: scrollPopUp(popUpData, callback)

You would pass in something that points to your data (the text and the image from a table you might have laying around), and a callback function for the pop up to call back and inform when it’s done (and pass back as arguments the user choices, if there are any).

The scrollPopUP function would load/create the background (a rect at least, but it could be an image of course), format/display the text, show the food image or whatever, setup the ok, select, or other buttons, and exit. Once the user pressed the buttons finalizing their choices, the button handler for the popUP would clean up (remove the graphics/text), and fire off the callback to your main code to handle the results.

Sounds harder than it is, I guess.

I’d use a tableView inside the scrollView. tableView contains the menu items. When a menu item is tapped I would use storyboard.showOverlay() to bring up the detail overlay with image + text. This is easy to setup and works well.

You’re basically right all around.

You don’t want to insert your pop up dialog into your scrollView. If you have an overall screen group, which the scroll view was inserted into, you’d want to insert the popup there. (if you’re not using an overall group for all the objects onscreen, you might want to consider it, it helps a lot in managing objects depth priorities.

You’ll probably want to make it a utility function, called like: scrollPopUp(popUpData, callback)

You would pass in something that points to your data (the text and the image from a table you might have laying around), and a callback function for the pop up to call back and inform when it’s done (and pass back as arguments the user choices, if there are any).

The scrollPopUP function would load/create the background (a rect at least, but it could be an image of course), format/display the text, show the food image or whatever, setup the ok, select, or other buttons, and exit. Once the user pressed the buttons finalizing their choices, the button handler for the popUP would clean up (remove the graphics/text), and fire off the callback to your main code to handle the results.

Sounds harder than it is, I guess.

I’d use a tableView inside the scrollView. tableView contains the menu items. When a menu item is tapped I would use storyboard.showOverlay() to bring up the detail overlay with image + text. This is easy to setup and works well.