Welcome,
Guest
. Please
login
or
register
.
January 22, 2025, 03:35:14 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Disable all the Backgound collider when the UI is enable.
« previous
next »
Print
Pages: [
1
]
Author
Topic: Disable all the Backgound collider when the UI is enable. (Read 2518 times)
abhaya.agrawal
Newbie
Thank You
-Given: 2
-Receive: 0
Posts: 11
Disable all the Backgound collider when the UI is enable.
«
on:
July 25, 2015, 04:31:11 AM »
There are so many objects in my game. and all of them have the collider to detect touch. Whenever I open menu and i touch any option on that the background object also detect the touch.
what can i do to stop this.
Logged
devomage
Sr. Member
Thank You
-Given: 7
-Receive: 67
Posts: 250
Re: Disable all the Backgound collider when the UI is enable.
«
Reply #1 on:
July 25, 2015, 03:59:29 PM »
not sure if its the best solution - i use a "cover" uisprite that covers the entire screen. this uisprite also has a collider that blocks all input to anything under it. the controls you want to work with are above the "cover" and will work as intended.
you could omit the uisprite if you didnt want the "grayed out effect".
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Disable all the Backgound collider when the UI is enable.
«
Reply #2 on:
July 27, 2015, 08:29:02 PM »
Assuming you are talking about events going through your background object that has no collider, the solution is simple: add a collider to it.
Logged
abhaya.agrawal
Newbie
Thank You
-Given: 2
-Receive: 0
Posts: 11
Re: Disable all the Backgound collider when the UI is enable.
«
Reply #3 on:
July 29, 2015, 01:54:34 AM »
@Aren : I can do that. But I want whenever any menu is there if I click on any objects which are not covered by menu, should not respond.
also when i click outside, I want that the menu should close.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Disable all the Backgound collider when the UI is enable.
«
Reply #4 on:
July 31, 2015, 09:26:24 PM »
So... do that?
2 colliders. One on the window's background, one on the invisible widget covering the screen behind it (ALT+SHIFT+W, ALT+SHIFT+C). When you click on the screen collider, close the window.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Disable all the Backgound collider when the UI is enable.