2D Toolkit Forum

2D Toolkit => Support => Topic started by: Companella on July 03, 2013, 11:40:30 am

Title: about mouse(touch) events
Post by: Companella on July 03, 2013, 11:40:30 am
dear any~
If my ui button received a mousedown or touchdown event, also my game world can be receive the event too, but i won't.
so, how to do to that my game world can't receive this mousedown event ?

Please!
Title: Re: about mouse(touch) events
Post by: unikronsoftware on July 03, 2013, 11:53:10 am
Easy solution - put a huge invisible collider behind all the UI, so it blocks the ray into the scene.
Title: Re: about mouse(touch) events
Post by: Companella on July 03, 2013, 12:19:14 pm
However, sometimes i need the event post in to game world.
eg: control my hero move, two finger scale the screen.
Title: Re: about mouse(touch) events
Post by: unikronsoftware on July 03, 2013, 07:53:49 pm
A button isn't a good control if you want to do 2 finger scales... if you still want to use it, you should hook into the ui manager to detect 2 finger scales. This is very specific to your game (you didnt' even mention 2 finger scale in your first post), and the solution will be pretty specific too.
Title: Re: about mouse(touch) events
Post by: Companella on July 04, 2013, 03:45:06 am
Thank you
Title: Re: about mouse(touch) events
Post by: Companella on July 04, 2013, 05:39:16 am
ok, "put a huge invisible collider behind all the UI" work perfectly~
Thank you for this idea~