Log In  

There's no concise tutorial or code I can track down that could help explain to me how to call and control multiple 8x8 sprites as one. I'd like to use 4 8x8 spirtes as a larger character. There aren't many games that do this and I'm not yet good enough to really parse where in the code this gets described. If anyone knows where I could find this info I'd really appreciate it!

P#37823 2017-02-25 17:06 ( Edited 2017-02-25 22:44)

" spr n x y [w h] [flip_x] [flip_y]

    draw sprite n (0..255) at position x,y
    width and height are 1,1 by default and specify how many sprites wide to blit.
    Colour 0 drawn as transparent by default (see palt())
    flip_x=true to flip horizontally
    flip_y=true to flip vertically"

From the manual. The w and h values control how many sprites you blit together. 2,2 for 16x16 pixels. Basically, you choose the top left sprite for the n value, and then blit right and down.

For example, "spr(32,0,0,2,2,true,false)"

for sprite 32 in the spritesheet, blitted right and down on the spritesheet for a 16x16 sprite, at point 0,0, flipped on the x-axis, but not flipped on the y.

P#37825 2017-02-25 17:22 ( Edited 2017-02-25 22:30)

@zacharysandel

Thank you! Because of course it's in the readme. :p

P#37826 2017-02-25 17:44 ( Edited 2017-02-25 22:44)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 12:07:41 | 0.011s | Q:10