Adding a mini popup window with buttons on it

My goal is to create a half screen high popup style window that has buttons on it.

I’ve tried using the native.showPopup() and native.newTextBox() but they don’t seem to work.

is it possible to do what I am trying to accomplish?

You mean, they do work (they do what the docs say they do), but they do not produce the result you’re looking to achieve. 

The answer is “Yes, you can do this”.  However, it won’t be a one-liner.  You will need to code your own dialog box (what you’re calling popup) system or borrow from someone else if you can find one.

If you code it yourself, these are some possible parts you’ll need to code:

  • (optional) Full-screen image rect using a transparent texture, with a touch listener to catch touches not on the dialog buttons.
    • Used to keep touches from falling through to things underneath.
  • A newImageRect() or newRect() to act as the visual representation of the dialog tray.
  • Buttons
  • Touch Listeners for the buttons.  

And if you are using Composer it’s what “Overlay” scenes are for. Rob

Hi again.  I didn’t mention Composer because I thought, why add more to learn on top of what you’re doing.  However, Rob is right.  The easiest way to achieve your result is probably w/ Composer.

So, let me post something about that…

We did a whole talk on the Compose scene manager here:

https://coronalabs.com/blog/coronageek/composer-library-series-hangout-highlights/

The code (including a framework with an overlay) can be found here:

You’d be well served to browse this code, including the framework (folder 5_frame) that I made.  

You may not entirely follow my organizational strategy, but it should give you a solid foundation for setting up, organizing, and using composer to manage your scenes.

I am indeed using composer; thank you all for your input!

EDIT:

For those who are trying to do what I’m attempting, I decided to use composer.showOverlay()

https://docs.coronalabs.com/api/library/composer/showOverlay.html

You mean, they do work (they do what the docs say they do), but they do not produce the result you’re looking to achieve. 

The answer is “Yes, you can do this”.  However, it won’t be a one-liner.  You will need to code your own dialog box (what you’re calling popup) system or borrow from someone else if you can find one.

If you code it yourself, these are some possible parts you’ll need to code:

  • (optional) Full-screen image rect using a transparent texture, with a touch listener to catch touches not on the dialog buttons.
    • Used to keep touches from falling through to things underneath.
  • A newImageRect() or newRect() to act as the visual representation of the dialog tray.
  • Buttons
  • Touch Listeners for the buttons.  

And if you are using Composer it’s what “Overlay” scenes are for. Rob

Hi again.  I didn’t mention Composer because I thought, why add more to learn on top of what you’re doing.  However, Rob is right.  The easiest way to achieve your result is probably w/ Composer.

So, let me post something about that…

We did a whole talk on the Compose scene manager here:

https://coronalabs.com/blog/coronageek/composer-library-series-hangout-highlights/

The code (including a framework with an overlay) can be found here:

You’d be well served to browse this code, including the framework (folder 5_frame) that I made.  

You may not entirely follow my organizational strategy, but it should give you a solid foundation for setting up, organizing, and using composer to manage your scenes.

I am indeed using composer; thank you all for your input!

EDIT:

For those who are trying to do what I’m attempting, I decided to use composer.showOverlay()

https://docs.coronalabs.com/api/library/composer/showOverlay.html