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

Drawing a screenshot

?

(-_-)

Guest
I tried to draw a screenshot but I couldn't. I can save the sprite in .jpg format but can't draw. Codes:
ss=sprite_create_from_screen(0,0,1366,768,false,false,0,0);
I get the id, then trying to draw:
draw_sprite(ss,0,0,0);
but nothing happens... Pls help.
 
?

(-_-)

Guest
I use Game Maker 8.1 pro.I used sprite_create_from_screen in mouse enter event and drawed it in different object in draw event.
 
A

Aura

Guest
First of all, make sure that you're getting rid of the sprites because dynamic resources are very expensive performance-wise. Delete the sprite that you created earlier with the help of sprite_delete() before creating another one.

Second of all, how are you reading the value of ss? Because it is a variable local to another object. Either use a global variable or explicit scope (object.ss).

If that does not help, please post all the relevant code; post the object information of both the objects. Also make sure that at least one instance of both the objects is present in the room. Also make sure that you are using the correct Mouse event; Mouse Enter seems to be a weird choice. What are you trying to do?
 
?

(-_-)

Guest
Thnx for your help. I was using an object for all drawing events. I did it with variables ( If (global.letsdraw==1) { draw_sprite... etc.) This made a problem about depth. Deepest layer was background sprite, I created an object above it, then I wanted to draw a info box above the object but drawed sprites and text was under the object.
I solved it using background_visible[0]=true; background_index=city_bg; I set the object's depth "1". :)
 
Top