0
//Object 1: (draw event)
draw_text(x,y, global.Score);
draw_set_alpha(0.5);
//Object 2: (draw_event)
draw_text(x,y, global.highscore);
draw_set_alpha(1);

The problem is, that the drawn objects (without sprites) sometimes have the alpha from the other, or even ignores the "draw_set_alpha();" (The same in step-event)

Raphael
  • 3
  • 2
  • Set alpha before draw, not after. And after draw, set alpha to 1 (otherwise it will have effect on objects with normal sprites) – Dmi7ry Sep 13 '16 at 19:38

1 Answers1

0

When you use draw_set_alpha(), as well as other draw_set_.. methods, you change global settings for drawing everything after it across the entire project.

Take as a rule, revert such settings back, after you draw the needed thing. So, according to your code above, you should use this:

//Object 1: (draw event)
var prev_alpha = draw_get_alpha(); //getting current alpha settings
draw_set_alpha(0.5); // setting needed alpha
draw_text(x,y, global.Score); //drawing text with 0.5 alpha
draw_set_alpha(prev_alpha); // setting alpha setting back

// the same for the second object
//Object 2: (draw_event)
var prev_alpha = draw_get_alpha();
draw_set_alpha(1);
draw_text(x,y, global.highscore);
draw_set_alpha(prev_alpha);
Fill Freeman
  • 189
  • 9
  • I described common approach. I do not know specific of your project. So, take a look at GM:S help, or provide us with more info. I did not check this exact code it the real project, so there could be some mistakes in details. I did such things in my own projects, and it worked perfectly. – Fill Freeman Sep 23 '16 at 11:46