Author Topic: Detecting if some area is not clicked / tapped etc.  (Read 3045 times)

SheepIt

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 5
    • View Profile
Detecting if some area is not clicked / tapped etc.
« on: October 31, 2014, 01:52:54 PM »
so my main issue was that I wanted to delete some elements on loosing focus of a UIInput field.
So my first thinking was deleting them in a method called bei OnDeSelect but clicking on the elements that should be deleted looses focus of that as well.. that screwed up everything of course.

Any idea to that?

If not, am I left with detecting if the user tabs outside of a collider that I define?

How would I do that for multiplattforms? (so touch and mouse events should be covered)


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Detecting if some area is not clicked / tapped etc.
« Reply #1 on: November 01, 2014, 07:48:19 AM »
Set a generic event listener like UICamera.onClick. It will be triggered every time you click on something, and inside you can determine what you clicked on, and whether it's considered to be lost focus or not, and act accordingly.