Drag And Drop different objets set draw color

Y

Yotzer

Guest
hi guys
another noob question,(in fact I am ashamed to ask).
I was making a simple game where I have a score and at the end of the game the score is displayed as "your score" in the middle of the screen.
I want it to have a different color than the rest of the text (different objects),but when I change it it changes all the texts.
I am sure it is simple and I am going to hit my head with my hand when I get the answer.
 

Alexx

Member
You could also use the following, which will ensure the colour is reset to the previous value.
Code:
last=draw_get_colour();
draw_set_color(c_red);
draw_text(x,y,"red text");
draw_set_color(last);
However, in most cases it is best to set the drawing colour / formatting just before drawing any text.
 
Y

Yotzer

Guest
You could also use the following, which will ensure the colour is reset to the previous value.
Code:
last=draw_get_colour();
draw_set_color(c_red);
draw_text(x,y,"red text");
draw_set_color(last);
However, in most cases it is best to set the drawing colour / formatting just before drawing any text.
thanks but it's just a stupid game based on a drag & drop tutorial,not worth the effort in that case.
anyway I liked it ,it's good for when you are really coding and you have no idea what will be the last color you used,great.
I love this community;)
 
Top