• 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 Visual Trail of instances left behind a dragged object, how fix?

B

bebesnuggles

Guest
I have no draw script, yet when I use the drag event and have the object's X and Y coords go to the mouse's X and Y. However when I do this, even on a new object it leaves a trail behind. I've tried to circumvent this by drawing the instance, only with an alpha of 0. Doesn't work. Has anyone had this happen? How should I solve it?
Thanks,
 

chamaeleon

Member
I have no draw script, yet when I use the drag event and have the object's X and Y coords go to the mouse's X and Y. However when I do this, even on a new object it leaves a trail behind. I've tried to circumvent this by drawing the instance, only with an alpha of 0. Doesn't work. Has anyone had this happen? How should I solve it?
Thanks,
Do you have a background defined for the room?
 
B

bebesnuggles

Guest
in GMS 2 make sure your room at least has one background layer that is set to visible and is a solid color or an image with no transparency in it.

THANK YOU SO MUCH BRO
I've been working on this for the past couple of days. Of course just one small change will fix everything lol
Thanks again
 

Roderick

Member
In case you're wondering why that happened:

Game Maker doesn't clear the screen when drawing. Instead, it draws the background on top, and then redraws everything else that should be on the screen. If you don't have a background, or if part of the background is transparent, any of the parts that aren't redrawn keep whatever was there before, and then it draws new stuff on top of that. Since you were never covering the screen with a new background, all the old drawings of your object were being left behind.
 
Top