Author Topic: More control over Text Input field behaviour  (Read 427 times)

Trithilon

  • Guest
More control over Text Input field behaviour
« on: October 21, 2012, 06:23:24 AM »
Hello,
I need to do two things :

1: Have a TextInput Field only accept a certain length of Strings? (It should not let the player type anything more than - say - 10 characters)

2: Reset the TextInput Field with code & Restore the original Default grey text? (I restore the text by setting the ".text" of the Component... but its not grey)

How should I do this?

Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: More control over Text Input field behaviour
« Reply #1 on: October 21, 2012, 03:34:52 PM »
1. You can limit input string length by specifying UIInput's "Max Chars" property to something other than 0.
2. Set the .text to an empty string / null.

Trithilon

  • Guest
Re: More control over Text Input field behaviour
« Reply #2 on: October 21, 2012, 03:46:49 PM »
Thanks. :)