Author Topic: Prevent UIInput from scrolling  (Read 1984 times)

artician

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 54
    • View Profile
Prevent UIInput from scrolling
« on: March 12, 2014, 12:29:45 PM »
Hi,
I have a UIInput field that is a fixed size.  8 lines with 12 characters per-line.  I want the field to display all 96 characters at all the time, and I have the starting value filled out with 96 placeholder characters to begin with. 

I'm having several problems with this.  Firstly, when the input field is clicked by the user, the cursor jumps to the end of the text.  This isn't so much of a problem except that the text field will scroll up and out of view to display only the last few characters in it (this is a behavior with the Input field itself, please note I'm not talking about a Scroll-View, which I'm not using here).  If the user presses the up arrow repeatedly, the lines will scroll back down and display. 

Essentially I want this paragraph to display at all times, no scrolling within the input field, and allow the user to simply click it to edit without moving the text automatically. 

I have the UILabel set to display exactly 8 lines of text, with Clamped Content and a Character Limit on the UIInput component set to 96 characters exactly.  How can I keep this from scrolling?

Thank you in advance.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Prevent UIInput from scrolling
« Reply #1 on: March 12, 2014, 09:13:40 PM »
Why would it scroll? If the label is multi-line the input will also be multi-line. The example Simple Text Box control that comes with NGUI has multi-line input. As long as the "Starting Value" is set, it will work as you'd expect. It will highlight everything on selection, however.

I question whether a single input field would be the right way to go for what you're doing (I don't quite understand what this would be used for by the way). Maybe multiple lines of text, or just a custom script modifying a label would work better.

artician

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 54
    • View Profile
Re: Prevent UIInput from scrolling
« Reply #2 on: March 13, 2014, 07:32:30 AM »
Let me see if I can screencap the behavior to better explain.  I don't know why it would scroll either!  :)