Author Topic: How To: Autoscroll Text Adventure (Scroll View)  (Read 1910 times)

poolts

  • Newbie
  • *
  • Thank You
  • -Given: 6
  • -Receive: 0
  • Posts: 33
    • View Profile
How To: Autoscroll Text Adventure (Scroll View)
« on: June 14, 2014, 03:42:49 PM »
Hi guys,

I'm trying to work out how to make a view that scrolls as you type commands in. I.e. you type a command in, it gives you some feedback (i.e. can't travel west) and then gives you a new command prompt. Once you get to the bottom of the screen I want to be able to clip and scroll the top command i.e. going continually going downwards (just like how a command prompt like in DOS).

I've looked at the chat window example, as was thinking on submitting the UI input I write that to a UI label (exactly the same as the chat window example) and keep the command prompt anchored to the bottom of the window. Although I feel like I'm going to fall into the same trap as once I get to the bottom of the page and the UILabel grows the command prompt will eventually be cut off. Plus I can't have that wrote to the UILabel as it would lose it's input properties. Also I don't really want to clear the screen I just want it to continually grow.

It would be nice to save the history too, just like in the chat window example (but first things first, would be great to solve this problem first).

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How To: Autoscroll Text Adventure (Scroll View)
« Reply #1 on: June 15, 2014, 05:57:08 AM »
The chat window example has the auto-scroll as a part of it. Do you want an actual scroll view instead? Something like what I had in the Sprite-based UI video? I did that by having a label inside a scroll view, and basically resetting the scroll view's position every update.