Author Topic: Pop-up not blocking buttons behind and button delay questions  (Read 7308 times)

Quakeulf

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Hi,
Thank you so much to those who helped so far. :3 I have google'd around a lot but not yet found anything to answer my questions, so I found I must ask here.

Question 1:
How do I make a pop-up block the buttons behind it so that they cannot be clicked? I want it so that the buttons on the pop-up message are the only clickable buttons and the ones below it are not clickable. I am using a "fill" object with an UIStretch that fills the whole screen on top of the other buttons you are not supposed to click together with Z-indexing it way in front of them, but it does not work. I have checked the button collision detectors and they are behind on Z.

Question 2:
How do I add input delay to a button? I want it so that you can only click a button once every X seconds. (This should be easy, but I am new to this...)


Thank you all very much in advance for helping out. :3

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Pop-up not blocking buttons behind and button delay questions
« Reply #1 on: May 26, 2013, 12:54:19 PM »
1. Add a big collider covering them. This generally goes onto the window's background.

2. In OnClick disable the collider, then enable it again X seconds later.

Quakeulf

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Pop-up not blocking buttons behind and button delay questions
« Reply #2 on: May 26, 2013, 04:46:14 PM »
Great! I'll try that. Thank you for your help. :3

Quel

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Pop-up not blocking buttons behind and button delay questions
« Reply #3 on: December 22, 2013, 07:43:19 AM »
1. Add a big collider covering them. This generally goes onto the window's background.

And if this didn't work ? There are some logic sequence about how ngui decides which colliders are in front and which ones are behind ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Pop-up not blocking buttons behind and button delay questions
« Reply #4 on: December 22, 2013, 12:10:11 PM »
It's depth-based. Create a widget (ALT+SHIFT+W) and give it a collider. Its depth controls the order.

Quel

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Pop-up not blocking buttons behind and button delay questions
« Reply #5 on: December 23, 2013, 09:18:31 AM »
It's depth-based. Create a widget (ALT+SHIFT+W) and give it a collider. Its depth controls the order.

[Solved]
Looks like the problem was on UIButton didn't have any UISprite on it. I've been forced to put an empty sprite to set the appropriate depth.