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:

Is there another way to achieve this effect?

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

:: Felice

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)
:: DR4IG

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 2020-06-01 02:10 | 0.009s | 2097k | Q:15