How do I truncate text in textbox?

Get help using Construct 2

Post » Sat Nov 26, 2016 1:46 am

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?
B
60
S
20
G
56
Posts: 1,077
Reputation: 35,941

Post » Sat Nov 26, 2016 12:11 pm

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.
B
23
S
11
G
6
Posts: 181
Reputation: 5,003

Post » Sat Nov 26, 2016 10:40 pm

@megalocrator 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.
B
60
S
20
G
56
Posts: 1,077
Reputation: 35,941


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests