Author Topic: How to properly create a textfield that scrolls?  (Read 4578 times)

johnnyr

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
How to properly create a textfield that scrolls?
« on: February 01, 2013, 05:31:36 PM »
Hi Guys,

I'm trying to get the textfield to work right, but so far have everything working but the scrolling. No matter what I do haven't had any luck getting it to scroll.

What should I be looking at as a possible cause? (the scroll checkbox is checked). Does the textfield script need to be a specific type of object? (UIWidget?) Or a separate panel?

I'm sure i'm just doing something wrong, but I don't know what =(
« Last Edit: February 01, 2013, 06:33:46 PM by johnnyr »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to properly create a textfield that scrolls?
« Reply #1 on: February 02, 2013, 08:26:31 AM »
Just add a whole bunch of labels into a table/grid, and if it's all underneath a clipped panel with UIDraggablePanel on it, you will be able to scroll it just like any other panel.

johnnyr

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: How to properly create a textfield that scrolls?
« Reply #2 on: February 02, 2013, 09:17:57 AM »
Thanks for the reply, but i'm a bit confused. I'm trying to re-create the chat window example, where its just an object (panel?) with the textfield script, along with a label. All of this works, its just the scrolling that isn't =( When I take just the textfield/label from the chat window example into my project, it works great. So I just don't get what I'm doing wrong in creating my own.
« Last Edit: February 02, 2013, 09:42:08 AM by johnnyr »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to properly create a textfield that scrolls?
« Reply #3 on: February 02, 2013, 05:52:05 PM »
Chat window example isn't set up like what I suggested. It was created long before clipped panels were even implemented. I don't advise looking at it at all if you need a smoothly scrollable chat window.

alics

  • Guest
Re: How to properly create a textfield that scrolls?
« Reply #4 on: March 01, 2013, 11:37:58 AM »
I am facing the same situation. Using a label widget with the UITextList script and Input field everything work except for the scrolling. I am trying to duplicate the functionality of the Chat Window example. I even created a prefab out of the Text List widget and it worked in my scene except for the scrolling?!!!

Can you explain what makes it work in the Chat Window example and it doesn't work outside of it?

I appreciate the enlightenment!

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: How to properly create a textfield that scrolls?
« Reply #5 on: March 28, 2013, 10:09:59 AM »
I'm trying to do the same, But I would like the text scroll by itself and loops, should I create a MoveTo itween for this with loop? this should work with the scrollbar too?

gevarre

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: How to properly create a textfield that scrolls?
« Reply #6 on: November 22, 2013, 06:14:03 PM »
Bumping this old thread because it hasn't really been resolved, there is no real step-by-step tutorial on how to do chat windows, and the example hasn't been updated since ArenMook said in this thread that it was no longer the correct way to do this.

I, too, have just got a chat window working from the included example by copy-and-pasting from the example into my project and making the necessary corrections. However, the scroll function doesn't work just like the others. In my case, the UIText List and other components are under a 2D camera connected to a 2D UI Root like the other examples (I also have a lot of HUD elements there). The 2D camera is set to Depth Only, etc., and then there is a standard 3D perspective camera for the player. Everything is working perfectly except for the scrolling.

Since the scrolling is dependent on clicking on the collision trigger attached to the Text List, which is under the 2D camera that's below the main scene, would I be right in thinking that there's no way for the player to actually click on it from the main camera?

I can get my game to work without the scrolling, but it would be a nice feature to add. I'm just now sure how it would be hooked up in a 3D environment. I've tried hooking it up under the main camera so that the collision was actually on-screen, but that didn't seem to work either, though there's probably something obvious I missed.

Any thoughts?