Maximum Text Plugin Size

Get help using Construct 2

Post » Sun Nov 22, 2015 3:05 pm

Ok, I realize this is a really, really strange question but trust me, I have a need for a VERY large text box.

What's the maximum size, either in total pixels or height, that a text plugin can be?

When the size of the text plugin reaches a height of around 16,400 px, the text vanishes. The contents are still there and the box itself seems to be inteactable but the fonts just disappear. As soon as I reduce the height below 16,400 px, the text reappears.

Am I reaching the limitations of the text box plugin or is there some way around this?

Thanks
B
15
S
5
Posts: 124
Reputation: 1,687

Post » Sun Nov 22, 2015 4:13 pm

What would be the benefit of having that large a text-box?
Why not use multiple or split up the text?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Nov 22, 2015 6:19 pm

Thanks for the idea @LittleStain,

Again, I know this sounds odd but should I pull it off, I'll put a version up on the arcade. Let's just say it's something VERY different from anything else I've seen made in construct.

Multiple text boxes wouldn't work. First, I'd have to figure out how much text and at what font size fits within the 16.4k size. That means running multiple checks to see at what point the box exceeds that size. Then, if the text is larger than 16.4k, in order to make it look like one continuous block of text, I'd have to somehow split the text based on lines rather than words or tokens (difficult to do with wordwrap). Then, I'd have to position the next text box below that one and track it's position. etc...

It would be nightmarish.
B
15
S
5
Posts: 124
Reputation: 1,687

Post » Sun Nov 22, 2015 7:56 pm

Test it and see?

Let us know how it goes.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,349
Reputation: 4,692

Post » Sun Nov 22, 2015 7:56 pm

And, I found a workaround.

I turned WebGL off for the project and I stopped when the text plugin size reached 102k px height, which should be plenty for my purposes.

For some reason the WebGL has an issue with creating huge text plugins.

Fortunately, for my purposes, WebGL isn't essential... but it did make things work smoother.
B
15
S
5
Posts: 124
Reputation: 1,687

Post » Sun Nov 22, 2015 7:59 pm

Maybe try SpriteFonts?
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,349
Reputation: 4,692

Post » Sun Nov 22, 2015 10:28 pm

For my purposes, that would be out of the question. The fonts need to be changeable and of good quality.
B
15
S
5
Posts: 124
Reputation: 1,687

Post » Tue Nov 24, 2015 2:53 am

Use a textbox instead, and set the font size with some css. You can even scroll the editbox by using some javascript with the browser object.
https://dl.dropboxusercontent.com/u/542 ... croll.capx

The issue with the Text object is you're running into the browsers canvas size limit, and with webgl the texture size limit. You can circumvent it by using one text object per line if you still prefer to use them.
B
88
S
30
G
90
Posts: 5,113
Reputation: 60,837

Post » Tue Nov 24, 2015 11:03 am

Note Text Box is a different plugin to the Text object: Text Box is a form control, and Text is the normal way of labelling things.

In WebGL mode, text is rendered via a WebGL texture, since WebGL does not have the capability to directly draw text itself. This means you are limited by the maximum texture size of the system, which is typically around 4096, but on high-end system goes up to 16384 (which seems to match what you describe).
Scirra Founder
B
382
S
223
G
86
Posts: 24,002
Reputation: 189,821

Post » Tue Nov 24, 2015 12:08 pm

Thanks @Ashley. Glad you understood what I meant even though I misworded text and textbox. That perfectly describes what I was experiencing. The good news is, for my purposes, with WebGL turned off, the maximum text plugin size seems to be unlimited. And because the textbox plugin uses scrollbars with no way to detect if they were visible, and no ability to resize the box based on the text height, it was totally unsuitable for my purposes

I uploaded my app to the Scirra Arcade (even though it's not a game and didn't fit into any category) you can test it out in the new games/other games. It's named uPrompt Nomad (sorry, can't link yet)

As a test, I copied and pasted Moby Dick into the editor and the text plugin was able to display and scroll the entire novel in the text plugin with the font size at around 50px. It was a bit laggy but that test is an absolute extreme of what I'd expect it to do.

Thanks for confirming that WebGL wasn't going to work.

And thanks for C2! Along with being a shareware author, I'm now an app developer. I have just published this privately on the Chrome Web store as a free app and will be uploading the paid app in the next few days. Android and other platforms are soon to follow.
B
15
S
5
Posts: 124
Reputation: 1,687


Return to How do I....?

Who is online

Users browsing this forum: andersonaraujodl, Carlafnt, teha, Yahoo [Bot] and 11 guests