Game Development Community

How to change font size of GUITextCtrl in Gui editor?

by Sammy · in General Discussion · 04/19/2006 (6:02 am) · 5 replies

Hi all,

How to change font size of GUITextCtrl in Gui editor?
(It seems that there is no properties like fontSize, fontbold, etc.)

Thanks in advance
Sammy

#1
04/19/2006 (6:08 am)
You need to use the GUIText Profiles, you can define your own, I'm pretty sure - but I haven't done it at the moment, in scripts.

For example using "GUIText24Profile" will mean your font is larger, and using the standard profile, it's going to be smaller. :)

Look in /common/gui/profiles.cs, around line 366 is the profile for the larger font, it works off the default "GUITextProfile", but just changes the size.

Also, look through lines 129 to 142.

Hope that helps,
Tom.
#2
04/20/2006 (5:51 pm)
Hi Tom Bushby,

Thank you for your reply.
I will try it.

Sammy
#3
04/20/2006 (6:21 pm)
Does anyone know of a way of changing the fontSize on the fly? There was some mention of it in some threads a while back, but I didn't hear of any particular solutions.
#4
04/21/2006 (8:28 am)
You either modify the profile at runtime or you use a MLcontrol and modify the text directly, for example.

Hey
Hey

or whatever the syntax is (: I don't remember, but that's the basics.
#5
04/21/2006 (9:05 am)
Criminy, I must have done something wrong before; I tried it again and switching the profile did the trick. Thanks.

Edit: Now I remember...I tried changing the fontsize of the profile itself. The correct way is to create a profile beforehand with a different fontsize.

Though I'm not sure how you could do that while allowing the player to specify the fontsize they want, without creating a profile for every fontsize...