• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker draw_set_colour

How do I put a variable into draw_set_colour in GMS2?
Code:
global.second_colour = "c_yellow";
draw_set_colour(global.second_colour);
draw_rectangle(340, 600, 940, 650, true);
When I do this it tells me that the draw_set_colour is wrong :(
Error is "draw_set_colour argument 1 incorrect type (string) expecting a Number (YYGI32)"

James
 

FrostyCat

Redemption Seeker
Do you know the difference between pi and "pi"? If you do, you should know what the problem with your first line is and what to do about it.
Code:
global.second_colour = c_yellow;
 
Top