How do I resize text in a Text object?

Get help using Construct 2

Post » Wed Oct 01, 2014 11:40 am

According to the Text object manual, this object does not display anything if its bounding rectangle is too small to fit a single letter of text.

Is there a way to resize the text in the Text object, so it will be smaller and fit?
B
5
Posts: 24
Reputation: 280

Post » Wed Oct 01, 2014 11:43 am

Use the action "Set font size".
Text plugin manual article
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,295
Reputation: 70,795

Post » Wed Oct 01, 2014 11:49 am

Message: Erez is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
Kyatric wrote:Use the action "Set font size".

But how do I know what size to use? My text is dynamic, and I want the largest possible font size.
B
5
Posts: 24
Reputation: 280

Post » Wed Oct 01, 2014 11:59 am

You know the size in pixels of your text object. You can know the number of characters of your text thanks to the system expression "len()".
Divide one by the other, and you should be able to determine the text size you need.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,295
Reputation: 70,795

Post » Wed Oct 01, 2014 1:34 pm

Message: Erez is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
Kyatric wrote:You know the size in pixels of your text object. You can know the number of characters of your text thanks to the .
Divide one by the other, and you should be able to determine the text size you need.

I don't think you are correct.

Yes, I know the size in pixels of the text object.
Yes, I know the number of characters of the text line.

From this, I can tell what size in pixels each char should be, but this is not the correct value of the "font size" to be used.
B
5
Posts: 24
Reputation: 280


Return to How do I....?

Who is online

Users browsing this forum: piranha305 and 42 guests