AIrlan Bragi
Member
Hello,
I'm using a font generated by a vector sprite (swf). Because I need to draw texts in several different sizes (300px, 200px, 150px, 120px, 80px, etc.), which would generate a lot of memory expense with all the generated images for each different size from the same source.
Also I can not just use the larger font and resize with draw_text_transformed, because that would leave the edges serrated, which is unpleasant. (and the largest size is 300px, loading all the characters I need would already generate a huge expense with all the generated images)
Everything flows well in my tests on windows. But, when I test on android, it does not work properly. Some texts are simply not drawn.
Apparently it's some GameMaker optimization to prevent fps loss. But how can I circumvent it? I prefer the game to be slower than having elements fade from the screen to the player. I have several other huge images (the game is being made in 1080p) and it is more advantageous to use vectors.
How can I ensure that everything that is being requested will in fact be drawn on the screen?
Thank you in advance for your attention!
I'm using a font generated by a vector sprite (swf). Because I need to draw texts in several different sizes (300px, 200px, 150px, 120px, 80px, etc.), which would generate a lot of memory expense with all the generated images for each different size from the same source.
Also I can not just use the larger font and resize with draw_text_transformed, because that would leave the edges serrated, which is unpleasant. (and the largest size is 300px, loading all the characters I need would already generate a huge expense with all the generated images)
Everything flows well in my tests on windows. But, when I test on android, it does not work properly. Some texts are simply not drawn.
Apparently it's some GameMaker optimization to prevent fps loss. But how can I circumvent it? I prefer the game to be slower than having elements fade from the screen to the player. I have several other huge images (the game is being made in 1080p) and it is more advantageous to use vectors.
How can I ensure that everything that is being requested will in fact be drawn on the screen?
Code:
///On Create:
font_CenturyGothic = font_add_sprite_ext(spr_font_CenturyGothic,"!\"#$%&'()*+, -./0123456789:;;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}¦©®°²³¹º¿ÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝàáâãäçèéêëìíîïñòóôõö÷ùúûüýÿ‘,’‘“”•…'\"∞",true,80);
font_scale = 1;
font_s300px = 0.37;
font_s200px = 0.275;
font_s150px = 0.206;
font_s120px = 0.165;
font_s100px = 0.145;
font_s70px = 0.1;
font_s60px = 0.087;
font_s50px = 0.075;
font_s40px = 0.057;
font_s30px = 0.041;
///When to draw text:
//Example1:
draw_set_font(font_CenturyGothic)
font_scale=font_s200px
draw_text_transformed(10,10,string(VAR_GRANA),font_scale,font_scale,0)
//Example2:
draw_set_font(font_CenturyGothic)
font_scale=font_s50px
draw_text_transformed(x,y,"Zen",font_scale,font_scale,0)
Thank you in advance for your attention!
Last edited: