• 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!

GML [SOLVED] Draw GUI doesn't work with code, only DnD.

Dr_Nomz

Member
So I have this:
Code:
draw_set_font(fnt_2);
draw_set_color(c_fuchsia);
draw_text(x+100,y+100,ammo_count);
But every time I MOVE, the variable moves too. Off screen, if I move too far. I have the exact same thing in different object but with DnD functions instead of code, and it works fine. Seriously, why is this and how do I make it not broken?
 

FrostyCat

Redemption Seeker
(x+100, y+100) is an in-room coordinate, not an on-screen coordinate. Of course it'll shift with your player. The reason it worked with your D&D actions is probably because you didn't add x or y or have the Relative box checked in them.

Whenever I see x or y being added raw to a drawing coordinate in the Draw GUI event, I smell someone who skipped classes on basic events.
 

Dr_Nomz

Member
Yeah, but...


That works just fine as is, and those coords set where the text is drawn based on the port on screen. (starting at 0,0)
So, is that not normal?

EDIT: Just removed the "x,y" values and just did "100" and it worked. >_< Thanks for the help. :/
 
Top