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?
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?