playMaker

Author Topic: How to Detect When a UI Input Field is Active and Freeze Controls?  (Read 1387 times)

westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
When players click on the input field and start typing, the key-based controls still go wacky and operate normally, when they should be frozen.

I've just started trying the UGUI, so I am curious how to have something that checks if the field is active each frame, and keep other controls disabled during this time.

Here is a video of the problem. Check at the 8:17 mark.



westingtyler

  • Sr. Member
  • ****
  • Posts: 277
    • My Video Game Projects Web Site
Re: How to Detect When a UI Input Field is Active and Freeze Controls?
« Reply #1 on: August 28, 2018, 01:21:13 AM »
I've solved it! it turns out there's a Set and Get Property feature for Input Field objects: IsFocused. Just get that bool, and prevent other commands that attempt to execute, until IsFocused bool is false. Get/Set Property is super powerful. So much to learn!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to Detect When a UI Input Field is Active and Freeze Controls?
« Reply #2 on: August 28, 2018, 03:51:55 AM »
Hi,

Cool, it's good that you found your way out of this, but be aware there is a dedicated action for this: UiInputFieldGetIsFocused

 Bye,

 Jean