How do I truncate text in textbox?

0 favourites
  • 3 posts
From the Asset Store
Forget about default textbox restrictions, you can create sprites atop of the textbox
  • I'm using a textbox set up as a scrollable textarea to display scrolling text on a page. Think of it like an old chat room where the new text shows up at the bottom and the existing text moves up a line. To do this I'm updating the new text like this:

    TextBox.Text&newline&"this is the next line of text" The way I have it set up currently the textarea will fill up indefinitely. What I would like to do is try to figure out a way to truncate the text at the top after x number of lines, or x number words, something like that. Is that something that can be done?

  • Not sure... what you mean, "truncate"? Like, keeping the same dialogue box size while the text kinda "overflows:hidden", dissapearing over the top? I think this is standard for text (now i do never use text, i prefer spritefonts), with Vertical Alignement: Bottom. If the textbox keeps growing, I guess you could also state the box dimensions whenever you append a new line (everytime the text changes, set the width and height again.

    Not sure if that was yr doubt tho...

    Note: use spritefonts! They behave better on phones, and look better anywhere, imo.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No, I mean that after 100 lines of text or whatever I decide are added, the ones on top start disappearing as new text is added at the bottom (By disappearing I mean getting deleted from the textarea box, not just going above the visible area.).

    And, I do normally use spritefonts on my projects, but this one requires something else.

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