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

draw_sprite_part messed up?

D

dugtrioramen

Guest
so i need part of my object to not be visible when colliding with something and i have somethings like this:

if place_meeting(x,y,obj_grass){draw_sprite_part(sprite_index,image_index,0,0,sprite_get_width(sprite_index),sprite_get_height(sprite_index)-12,x,y)
}
else draw_sprite(sprite_index,image_index,x,y)


the right amount of my sprite is showing, but it is positioned a bit below where it should be, as in the top of the sprite goes down when colliding.

I also did a test

if place_meeting(x,y,obj_grass){
draw_sprite_part(sprite_index,image_index,0,0,sprite_get_width(sprite_index),sprite_get_height(sprite_index),x,y)
}
else draw_sprite(sprite_index,image_index,x,y)

they should both be showing the same image (right?) but the top one again shows up a few pixels lower than the later.

And i can't be 100% sure, but for the top one, the draw_sprite_part, the sprite's y position seems to be alligned with the grid in the editor, except i cant be sure because its in game.
Does draw_sprite_part for some reason snap to the grid cell? Or am i just completely messing up?
 
Top