Author Topic: Making modal dialogs - want a "dimmer" background  (Read 7582 times)

Thurinus

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Making modal dialogs - want a "dimmer" background
« 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

JRoch

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 140
    • View Profile
Re: Making modal dialogs - want a "dimmer" background
« Reply #1 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.

Grand_A

  • Guest
Re: Making modal dialogs - want a "dimmer" background
« Reply #2 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

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Making modal dialogs - want a "dimmer" background
« Reply #3 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.