Text does not wrap properly in NON-WebGL mode

Bugs will be moved here once resolved.

Post » Wed Jan 21, 2015 7:14 pm

I'm trying to wrap text within a certain size of a text object.... and here's my issue:

My text object must only be 200x100 pixels big.... if the text is set to wrap by character, it looks like this:

NOTE: THIS ONLY HAPPENS IN NON-WEBGL MODE. IT WORKS AS EXPECTED IN WEBGL HOWEVER.
____________________________
|This is just a test. This is j|
|ust a test. This is just a te|
|st. This is just a test. This |
|is just a test.                       |
--------------------------------------
If I do it by word, it looks like this:
_________________________
|This is just a test. This is|
|just a test. This is just a |
|test. This is just a test.   |
|This is just a test.           |
-----------------------------------

Now... that's great.... BUT... if I had this instead of the text I mentioned: "abcdefghijklmnopqrstuvwxyz0123456789", it shows up like this:

By character:
_________________________
|abcdefghijklmnopqrstu|
|vwxyz0123456789         |
-----------------------------------

By word:

_________________________
|abcdefghijklmnopqrstu|vwxyz0123456789
|                                          |
-----------------------------------

Even though the text object's width is still set the same.

Attach a Capx
text.capx


Description of Capx
This CAPX has WebGL disabled. Try viewing it in the Debug layout - you'll notice it stretches beyond it's width.

Operating System and Service Pack
Windows 7 Pro 64bit with Chrome & IE

Construct 2 Version ID
r195
You do not have the required permissions to view the files attached to this post.
B
47
S
15
G
3
Posts: 201
Reputation: 4,625

Post » Tue Jan 27, 2015 5:34 pm

Closing as won't fix. This is just a quirk of canvas2d mode: it draws the text directly to the canvas, so it can end up drawing text outside the bounding box. WebGL mode by necessity uses an intermediary texture, and ends up clipping the text outside the bounding box. Fixing canvas2d mode to match WebGL mode would come with a performance penalty, and WebGL is approaching ubiquitous support now, so I'd prefer to leave it as is.
Scirra Founder
B
403
S
238
G
89
Posts: 24,659
Reputation: 196,165

Post » Tue Jan 27, 2015 5:44 pm

Awesome.
B
47
S
15
G
3
Posts: 201
Reputation: 4,625


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests