Log In  

I'd like to show multiple slices of a sprite. Stacking clips like this doesn't work, because the last one overrules the others:
clip(0,80,128,1)
clip(0,82,128,1)
clip(0,84,128,1)

Is there another way to achieve this effect?

P#44992 2017-10-08 10:45 ( Edited 2017-10-08 18:46)

The expensive way would be to set your clip slice, render the sprite, then set the next slice and render again, until you've got all your slices.

A better way would be to use sspr(), the scaling version of spr(), without any scaling. That way you get to specify the source rectangle in terms of pixels, rather than sprites. Then you can simply render the slices directly.

P#44994 2017-10-08 10:56 ( Edited 2017-10-08 14:56)

Maybe make a table containing tables?

P#44995 2017-10-08 11:15 ( Edited 2017-10-08 15:15)

Thanks! My solution was to draw multiple clipped sprites, but sspr seems a much cleaner solution.

P#44998 2017-10-08 14:46 ( Edited 2017-10-08 18:46)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 19:43:05 | 0.006s | Q:14