Author Topic: Activate a UIInput programmatically?  (Read 2397 times)

ealtorfer

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Activate a UIInput programmatically?
« on: May 25, 2013, 10:17:24 PM »
I think there must be something I fundamentally don't understand about what's going on under the hood with NGUI, but is there a way to manually activate a UIInput field? Rather than having it activate on click, I'd like to activate it when the user presses KeyCode.Return.

I've written code to show and hide the field, but no matter what I've tried, I can't seem to focus/activate the field so that the | character appears and the user can type. I've tried UICamera.selectedObject, but that doesn't seem to work.

Thoughts?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Activate a UIInput programmatically?
« Reply #1 on: May 25, 2013, 11:56:15 PM »
Use the UIInput.selected property.