Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Thurinus on December 07, 2012, 03:16:22 PM

Title: Making modal dialogs - want a "dimmer" background
Post by: Thurinus on December 07, 2012, 03:16:22 PM
Hi all,

First off, I apologize if this question turns out to be sophomoric.

Okay - so I'm trying to create a dialog with NGUI where the background gets masked by an alpha'd layer to make the dialog pop out more. I'm thinking of doing this by adding a UISprite and assigning it a flat-colour, alpha'd sprite, and then blowing up its size to cover the entire screen, and laying the dialog over that. I'm wondering if there's a better way to do this, perhaps even maybe without needing the physical sprite (i.e. creating the texture at runtime)?

Thanks for any help!
Jay
Title: Re: Making modal dialogs - want a "dimmer" background
Post by: JRoch on December 07, 2012, 04:51:30 PM
No, that's pretty much it.  And make sure that dim backdrop panel has a collider so that it catches clicks and prevents them fro interacting with items that aren't your modal top-level dialog box.

At least I'm doing it that exact same way.
Title: Re: Making modal dialogs - want a "dimmer" background
Post by: Grand_A on June 24, 2013, 11:09:58 PM
Hi Aren,

Seems like many people like to use NGUI for Modal Dialog which I'm using as well.
Would you kindly implement a function to like popup a modal dialog itself?
So that when the modal dialog is present, all other NGUI functions are not functioning
until the button in the modal dialog is pressed.
Then we can use a global/static function to call the modal dialog and replace the text.
Add an option also to either dim all the other NGUI elements or hide them completely.

If this feature can be added, that would be a very nice addition.
Thank you!  :D
Title: Re: Making modal dialogs - want a "dimmer" background
Post by: ArenMook on June 25, 2013, 01:12:00 PM
You don't need anything special for it. Make your dialog, add a big collider to it that would cover the entire screen, and when you show it, make sure it's in front of everything else.