Drag And Drop Sprite drawing problem

K

Kaerflortnoc

Guest
Hi everyone!

I'm new here and in GMS2
I'm trying to follow along a tutorial, but ran into a problem.
My sprite reacts to events up down left and right. That works!

But it gets drawn every step of the movement.

I drew the sprite myself, assinged it to an object. Theres nothing but four events triggering the movement.

I've tried deleting the object and remaking it. I haven't tried creating a new project.

But probably whilst fiddling with the program i've somewhere enabled something.

Has anybody encountered this? If yes => solution?
 

Simon Gust

Member
Hi everyone!

I'm new here and in GMS2
I'm trying to follow along a tutorial, but ran into a problem.
My sprite reacts to events up down left and right. That works!

But it gets drawn every step of the movement.

I drew the sprite myself, assinged it to an object. Theres nothing but four events triggering the movement.

I've tried deleting the object and remaking it. I haven't tried creating a new project.

But probably whilst fiddling with the program i've somewhere enabled something.

Has anybody encountered this? If yes => solution?
Can you show the code for those events. Is there code in the draw event?
 
K

Kaerflortnoc

Guest
Here's the event of that object.
I've also noticed right now, that the drawing appears on the instance layer, not in the tiles layer.
I have been toying with that draw event indeed, but I thought I deleted it.
 

Attachments

Simon Gust

Member
That doesn't look like a code error, that looks like you're forgetting to clear the display buffer. I'm not sure where it is in gms2 but in the room editor there should be a box that says clear display buffer or something, have that ticked. If there isn't one, just draw a background.
 
K

Kaerflortnoc

Guest
Strange. it was on in the room settings, i've tried on and off. Ran it, nothing changes.

:G

If i put a background in though it gets drawn behind the background.

I'm going to try a new project and import everything see if that fixes it.

Also i've checked the creation code of the object, cause I know I was messing around there too.
No code or anything. also the create event from the room...

Nice importing is disabled for free version :(
 
Last edited by a moderator:
K

Kaerflortnoc

Guest
I must've messed something up in the instances... my objects where getting real strange gibberish names.
Renaming didn't help.

What did help was:
Make new project and import the image files make new objects, load them into the new instance.
VOILA!

It gets drawn nicely now, not all over the screen.

EDIT: what actually happened => the background was in front of it so i didn't notice it!
if u put off background I still have my sprite drawn all over the place!
 
Last edited by a moderator:

Simon Gust

Member
I must've messed something up in the instances... my objects where getting real strange gibberish names.
Renaming didn't help.

What did help was:
Make new project and import the image files make new objects, load them into the new instance.
VOILA!

It gets drawn nicely now, not all over the screen.
That's just gms 2 being unstable of something, good that I still use 1.4 :p
 
K

Kaerflortnoc

Guest
That's just gms 2 being unstable of something, good that I still use 1.4 :p
And it's actually not solved => you just don't see it because the background is in front of it, I just noticed.

So if anyone else has had this problem?

Also thx for trying to help. Sorry for putting the solved tag!

I thought it was fixed but actually isn't.
 
K

Kaerflortnoc

Guest
Could anyone check? Just make a new project. Make a sprite, being a filled square.
Make an object, assign the sprite to it. place it in an instance. Make 4 events so it moves.
Disable the check for background and see if the sprite gets drawn all over the place?
I'm doing this right now.

I'll be back x)

Ok so:
New project, new sprite, new object, room's always there from the start.
If i dissable the checkbox of the background and run it.

This is what i get (picture) when moving around with the sprite (the blue cube)

ALL that I want is to confirm if anyone else has this and it's normal?

THX GUYS!!!
 

Attachments

Last edited by a moderator:
Top