Text Scaling

  • Thread starter Schwiftywaffles
  • Start date
S

Schwiftywaffles

Guest
I'm making a text based choose your own adventure game. I have it so that when F1 is hit my game goes fullscreen, which scales my text and makes it blurry. This is the code for my text boxes and my fullscreen.

TEXTBOX

draw event
Code:
//draw textbox

draw_rectangle(x-2, y-2, x+boxwidth+2, y+boxheight+2, false);
draw_sprite (sprite_storytextbox, 0, x,y);

//draw text
draw_set_font(font_text)

draw_text_ext(x,y, text, stringHeight, boxwidth - (2*xBuffer));
create event
Code:
text = "Where you type in what the textbox says "

xBuffer = 10;
yBuffer = 10;

boxwidth = sprite_get_width (sprite_storytextbox)

stringHeight = string_height(text);

boxheight = sprite_get_height(sprite_storytextbox)
FULLSCREEN
key press f1 event

window_set_fullscreen(!window_get_fullscreen());

I've tried multiple things and I just can't figure out how to scale it correctly.
 

shortbread

Member
Unfortunately all text in GameMaker is bitmap based (as opposed to the vector rendering you would see in most other applications), as such its essentially just a set of sprites.

To get around this issue you have a couple of options:
1. Create a couple versions of your font at different sizes, then use the closest one to the size you want. You can additionally try scaling a large font down but the quality of the output can degrade.
2. Use a custom vector font solution (I remember seeing a couple of implementations online at one point, but can't find them at the moment).
 
Top