• 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 Drawing Surfaces

P

philman401

Guest
I don't know what I am doing wrong. I have not used GM in a while and just got GM 2 recently. I've looked back in my previous games as well as online examples/tutorials but my surfaces can't seem to draw.

So at game start I create a surface:
Code:
global.msurface := surface_create(192,144);
And at a Draw GUI event:
Code:
surface_set_target(global.msurface);
draw_set_color(c_black);
draw_circle(0,0,25,0);
draw_surface(global.msurface,0,0);
surface_reset_target();
I also added the code to create surface if it no longer exists.

If I draw the circle normally w/o surfaces it appears, but once I try making a surface I can't seem to see it even though I have replicated a tutorial properly. I also tried using a regular draw event.

I am using views but everything atm is exactly at 0,0 of the room. My previous project uses views and drawing surfaces on the view but for some reason I can't get it to work with this new project.
 

Simon Gust

Member
currently you're drawing the surface on itself but you're never drawing it on the application surface which would be required for the surface to be visible
Code:
surface_set_target(global.msurface);
draw_set_color(c_black);
draw_circle(0,0,25,0);
surface_reset_target();

draw_surface(global.msurface,0,0);
 
Top