[Request] Scrollable Text

From the Asset Store
Template for scrollable list, fully documented in comment and video
  • Hi there,

    I was wondering if anybody would be able to make a scrollable text plugin for me. I need it for a chat box in an mmorpg I'm making with Construct 2, and needed the text to be able to fill up more than it's height worth of text. Would anyone be able to make one for me?

    Any help is much appreciated.

    Thanks!

    Dengke / ValkyrieGames

  • what about iscroll or multiline box ?

  • Hi septeven! Thanks for the leads. I actually had a look at them before but iScroll isn't what I need and multiline box is a TextBox rather than a Text (I need that portion's background transparent!) The multiline box I think I will be using for the text entry part of the Chat Box though!

  • Tell me exactly what you need.

    I'm pretty sure that iScroll could help you on this.

  • Well right now this is what I have:

    <img src="http://www.valkyriegames.net/wip/misc/scrollable_text_required.png" border="0" />

    And the Text portion of the textbox can be seen to the left. Right now after typing enough, the text, because each message is attached to the end, runs past the visible space of the textbox. I was hoping there was a version of the textbox which would let me scroll the text so I can see what's written at the bottom. Preferably the textbox would also shift the text so that the bottom most entry is visible. Will the iScroll plugin help with that?

    Thanks for your help!

  • Only load the last few lines into text object or whatever you're using there. It doesn't need to contain the entire log, does it?

    And with some simple logic you can scroll. As easy as selecting the lines to display.

  • Hi Mipey, that's a good idea, except the problem is I can't find out a way to decide how many lines are in the Text. For example, I can count newlines but text wrapping means that more lines are used than there are newline characters. Do you know any easy way to find out the number of lines in a Text object?

    Thanks!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hm, you could try a while loop with the TextHeight expression.

    + While Text.TextHeight < ChatHeight

    Text.Append(a line to append)

    It should stop adding a line when the chat height is exceeded. Oh, and add a guard condition to make sure it doesn't loop infinitely (such as if there aren't enough lines to fill the chat).

  • Ohh really I didn't know there was a TextHeight expression. I will try it out. Thanks! :D

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)