J
JoshuaJSlone
Guest
I want to do some sprite combining by way of surfaces, and before I did anything complicated I wanted to try the test case of duplicating a sprite by way of surface. Create a surface exactly the size of the sprite, draw the sprite there, create a sprite from that surface, and then tell an existing object to start using the new sprite instead.
If this was working exactly, I'd think the before and after should be a total match. However, they're not quite. Actually, I found that if I turn off "Interpolate colors between pixels" they are a perfect match, but with it on there are slight differences. Are there some sort of interpolation settings in sprites that aren't by default the same in a sprite created this way and one created from the GUI?
The differences are subtle, but I think more apparent in motion. The original sprite is on the left, while the copied sprite is on the right. The copied sprite seems to have thinner/darker gray lines compared to the original. The copied sprite also seems to have greater smoothing on the outside of the diagonal white lines seen at the corners of the object here.
var surf;
surf = surface_create(64, 64);
surface_set_target(surf);
draw_clear_alpha(c_black, 1);
draw_sprite(spr_ship, 0, 32, 32);
spr_custom = sprite_create_from_surface(surf, 0, 0, 64, 64, true, false, 32, 32);
surface_reset_target();
surface_free(surf);
sprite_index=spr_custom;
surf = surface_create(64, 64);
surface_set_target(surf);
draw_clear_alpha(c_black, 1);
draw_sprite(spr_ship, 0, 32, 32);
spr_custom = sprite_create_from_surface(surf, 0, 0, 64, 64, true, false, 32, 32);
surface_reset_target();
surface_free(surf);
sprite_index=spr_custom;
The differences are subtle, but I think more apparent in motion. The original sprite is on the left, while the copied sprite is on the right. The copied sprite seems to have thinner/darker gray lines compared to the original. The copied sprite also seems to have greater smoothing on the outside of the diagonal white lines seen at the corners of the object here.