Jump to content


Photo

Drawing transparent variables


  • Please log in to reply
2 replies to this topic

#1 Maxamilius291

Maxamilius291

    GMC Member

  • New Member
  • 5 posts
  • Version:GM8

Posted 02 March 2012 - 09:50 PM

Hey,

I'm wondering if theres any way to set the alpha value of a drawn variable, like a variable version of draw_sprite_ext. This is my first non-tutorial game on gamemaker, so sorry if this is a stupid question.
  • 0

#2 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • Retired Staff
  • 9260 posts
  • Version:Unknown

Posted 02 March 2012 - 09:59 PM

You can use draw_set_alpha(newAlpha) to set the alpha before drawing. So if you wanted to draw text at 45% alpha:

draw_set_alpha(0.45);
draw_text(...);
draw_set_alpha(1);

The last line is just to reset the drawing alpha to 100% so things drawn after it aren't also using a 45% alpha.

-IMP
  • 0

#3 Maxamilius291

Maxamilius291

    GMC Member

  • New Member
  • 5 posts
  • Version:GM8

Posted 02 March 2012 - 10:20 PM

You can use draw_set_alpha(newAlpha) to set the alpha before drawing. So if you wanted to draw text at 45% alpha:

draw_set_alpha(0.45);
draw_text(...);
draw_set_alpha(1);

The last line is just to reset the drawing alpha to 100% so things drawn after it aren't also using a 45% alpha.

-IMP


Thanks, it's working perfectly now :)
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users