Jump to content


Photo

Get current font


  • Please log in to reply
4 replies to this topic

#1 PetzI

PetzI

    GMC Member

  • GMC Member
  • 1025 posts
  • Version:GM8.1

Posted 17 June 2012 - 10:58 AM

Hi, I know you can use draw_set_font() to set the font to be used, but is there a way to know which font is currently being used? Something like draw_get_font() ?
  • 0

#2 Desert Dog

Desert Dog

    GMC Member

  • Global Moderators
  • 6409 posts
  • Version:Unknown

Posted 17 June 2012 - 11:51 AM

Not that I'm aware. :(
  • -1

#3 Blake

Blake

    GMC Member

  • GMC Member
  • 443 posts
  • Version:GM:Studio

Posted 17 June 2012 - 02:12 PM

Each time you change the font, you could set a separate variable to the same value and use that for your checks. Simple example:

//when you change the font
draw_set_font(fnt_1);
font_current = fnt_1;

//when you want to check the font
if font_current = fnt_1
{
    ...
}

Edited by Blake, 17 June 2012 - 02:13 PM.

  • 2

#4 PetzI

PetzI

    GMC Member

  • GMC Member
  • 1025 posts
  • Version:GM8.1

Posted 17 June 2012 - 04:03 PM

Yeah, I'll be using that workaround, thanks. It seems like a flaw in Game Maker not to have that, though. Do you think it would be possible through an extension?

Edited by PetzI, 17 June 2012 - 04:04 PM.

  • 0

#5 Desert Dog

Desert Dog

    GMC Member

  • Global Moderators
  • 6409 posts
  • Version:Unknown

Posted 18 June 2012 - 01:27 AM

Good idea, Blake.

Not sure about extensions (I never really used 'em) but certainly you could make your own script.

my_draw_set_font()
my_draw_get_font();

your checker variable would be embedded inside those functions.

Edit: Consider submitting a 'wish': bugs.yoyogames.com
  • -1




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users