playMaker

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

westingtyler

  • Full Member
  • ***
  • Posts: 236
    • View Profile
    • 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

  • Full Member
  • ***
  • Posts: 236
    • View Profile
    • My Video Game Projects Web Site
Re: How to Detect When a UI Input Field is Active and Freeze Controls?
« Reply #1 on: August 27, 2018, 10:21:13 PM »
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: 14703
  • Official Playmaker Support
    • View Profile
Re: How to Detect When a UI Input Field is Active and Freeze Controls?
« Reply #2 on: August 28, 2018, 12: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