Hello Guest

Author Topic: about mouse(touch) events  (Read 5426 times)

Companella

  • Newbie
  • *
  • Posts: 29
    • View Profile
about mouse(touch) events
« 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!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: about mouse(touch) events
« Reply #1 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.

Companella

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: about mouse(touch) events
« Reply #2 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: about mouse(touch) events
« Reply #3 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.

Companella

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: about mouse(touch) events
« Reply #4 on: July 04, 2013, 03:45:06 am »
Thank you

Companella

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: about mouse(touch) events
« Reply #5 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~