Author Topic: UIInput + Scrollbar  (Read 2406 times)

sunspider

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
UIInput + Scrollbar
« on: March 13, 2014, 02:09:07 PM »
I'm building a UIInput for a large block of text. I want a scrollbar to appear if the text extends beyond the allotted area.

I have pretty much everything working the way I want to without having to edit any NGUI core scripts. But I have run into the problem of when the user uses arrow keys to move the cursor out of the exposed scrollview. Obviously I want it to automatically scroll to keep the cursor in view... totally standard behavior. However I can't access cursor information from outside UIInput because it's protected.

Any thoughts about how to do this, or should I just tweak UIInput to make cursor info public? I thought it was worth asking because the behavior I'm trying to achieve is so standard.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIInput + Scrollbar
« Reply #1 on: March 14, 2014, 12:38:49 PM »
I'll expose it in 3.5.4.

sunspider

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
Re: UIInput + Scrollbar
« Reply #2 on: March 14, 2014, 03:29:40 PM »
Awesome. It would be really slick if NGUI just had an easy way to snap a scrollbar to your long text field without having to monkey with all the stuff I have. I am moving my label around in script as the UIInput changes size. Wasn't too hard, but might be for a beginner. I'll send you my code if you like.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIInput + Scrollbar
« Reply #3 on: March 14, 2014, 04:23:38 PM »
You're welcome to post it here -- you can post individual modified NGUI files too -- just don't post the entire project with NGUI in it.