Guest User

draw_sprite_halfpixel()

a guest
Jun 21st, 2014
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.78 KB | None | 0 0
  1. /// draw_sprite_halfpixel(sprite, subimg, x, y, xscale, yscale, rot, colour, alpha)
  2. //
  3. //  Works the same as draw_sprite_ext() but draws the sprite
  4. //  transformed about the center of its origin pixel instead of
  5. //  the top-left corner. This can be useful when you require a
  6. //  sprite to maintain the on-screen position of its origin pixel
  7. //  as it is scaled and rotated.
  8. //
  9. /// GMLscripts.com/license
  10. {
  11.     d3d_transform_stack_push();
  12.     d3d_transform_add_translation(-0.5, -0.5, 0);
  13.     d3d_transform_add_rotation_z(argument6);
  14.     d3d_transform_add_scaling(argument4, argument5, 0);
  15.     d3d_transform_add_translation(argument2+0.5, argument3+0.5, 0);
  16.     draw_sprite_ext(argument0, argument1, 0, 0, 1, 1, 0, argument7, argument8);
  17.     d3d_transform_stack_pop();
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment