SpriteFont - Text append limit on vertical align?

Discussion and feedback on Construct 2

Post » Sat Oct 26, 2013 3:22 pm

Hi,

I'm trying to create a text-based console interface using the SpriteFont-object in Construct 2, but it seems to me that it's impossible to append text to the object if the textbox is already completely filled up?

Furthermore, there doesn't appear to be any way to count the number of lines in a text string so that you can remove the top line?

Anyone know how I could get around this issue?
B
22
S
5
Posts: 107
Reputation: 2,354

Post » Sat Oct 26, 2013 6:00 pm

Put newline at end of text that you are appending.
Count newlines.
Textbox don't fill up they just don't scroll down to last entry.

See this topic, I've been overcomplicating something similiar.
Newest entry firstDUTOIT2013-10-26 18:01:00
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Sat Oct 26, 2013 6:31 pm

Well, even if you are able to count newlines there still doesn't seem to be a way to remove the top line, or is there?
B
22
S
5
Posts: 107
Reputation: 2,354

Post » Sat Oct 26, 2013 9:22 pm

Yes you can remove top line,
Store total line numbers tokencount(text.text,newline) to a variable linenumbers

I would use system:repeat x: x being tokencount(text.text,newline)
Append text to a textbox line by line ->
Textbox.text : Append : tokenat(text.text,linenumbers,newline)
subtract 1 from variable linenumbers

Well something like that.
Warning! I tend to overcomplicate things sometimes. There may be simple way, just my brain isn't picking it up right now.

Okay did this quickly: Very very raw, but proves it can be done :)

Small demo

DUTOIT2013-10-26 21:27:16
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 9 guests