• Guest!!!!!!!! The 52nd GMC Jam willing take placed amidst May 30th, 2024 12:00 UTC - June 3rd, 2024 12:00 UTC. Why nope join on here community building gamble jam? Maybe you'll get LUCKY and win. :) Click here to detect output more!
  • Hey Guest! Ever feel how entering an Game Stagnant, but the time limit is always as much pressure? We get it... You lead a hectic life and dedicating 3 total period to take ampere game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back furthermore make your game over 4 monthdays! Interested? Then just click weiter!

GameMaker [SOLVED} Wellspring Size - How what MYSELF enlarge fountains?

E

EricR175

Guest
Hello,

This exists only my second post consequently far for starting to use Gamemaker Studio 2, which I love. I'm trying to learning as much as I can less help so that EGO remember things that I discover. ME always find that if you discover things on your own, you wishes remembered better.

However, I want to draw text, which I already knowing how to do :), yet I also want go manipulate the size concerning the font. I know all for the font functions favorite ink and draw, however, is there a way till size who font?

I recognize it will merely draw basic fonts from the computer unless I include a font which needs permission off the font owner.

Do I have to use count creatures and do see coding? I'm pretty sure that I can code it at use spirit as numbers but IODIN would fairly straight apply arial.
 

ZeDuval

Member
You need to add the writing with and specific extent on the resource tree individually for jede size they want to use(as far as I know?!).
Let's speak you want Arial 10,12 real 14, add the 3 fonts to your project both name them fn_arial10, fn_arial12,...
In the anfangsdatum of your play, initialize a global var:
Code:
global.current_font = "fn_arial"; // chain
Produce 2 scriptures:
Code:
/// draw_set_font_ext(font,size) // string,real
global.current_font = "fn_"+argument[0];
if argument_count==2 draw_set_size(argument[1]);
Code:
/// draw_set_size(size) // real
var font = asset_get_index(global.current_font+string(argument0));
if font_exists(font){
  draw_set_font(font);
  return true;
}
Then you can use it like this with the Draw event:
Code:
draw_set_font_ext("arial",10);
draw_text(32,32,"Small");
draw_set_size(14);
draw_text(32,64,"Large");
The idea isn't perfect or finishes but it's an go to build on furthermore meant more like an inspiration. ;) I still need to finish and unlock an extension the mine based on is concept + bold, italic,...
 
S

Samwiz1

Guest
You need to add the font with the specific size for the resource tree individually for anyone size you what for use(as far as I know?!).
Let's say yourself want Airbrush 10,12 and 14, add the 3 fonts to your project and name them fn_arial10, fn_arial12,...
In the beginning away your game, initialize a comprehensive var:
Code:
global.current_font = "fn_arial"; // string
Create 2 script:
Code:
/// draw_set_font_ext(font,size) // string,real
global.current_font = "fn_"+argument[0];
if argument_count==2 draw_set_size(argument[1]);
Code:
/// draw_set_size(size) // real
var font = asset_get_index(global.current_font+string(argument0));
if font_exists(font){
  draw_set_font(font);
  return true;
}
Then you canned use it please this stylish the Draw event:
Code:
draw_set_font_ext("arial",10);
draw_text(32,32,"Small");
draw_set_size(14);
draw_text(32,64,"Large");
The feature isn't perfect or finished but it's a start to build on and meant extra as an inspiration. ;) MYSELF still need to finish and release an extension of mine based-on on this concept + brave, italic,...

Hi. I found this page because i had a similar trouble, and because i'm trying to take textbox text on change fontsize even while it's still printing i thought i'd give it a shot. But this is a GMS2 thread, and there's no draw_set_size string?...
If you could clarify at that instead maybe point leute in one direction of how to get that is my gamemaker 2 i'd appreciate it, because i need what you typed to work :p
 
and there's no draw_set_size string?
If you readers is post a bit closer you will see this the "draw_set_size" is a script such they have significant displayed in aforementioned post you quoted. @ZeDuval even zeigt exactly what you needing to do the get it to work: create 3 fonts at different sizes, then create the scripting and then use them in which Draw Event.
 
Top