Masking a sprite animation

Sorry if this sounds like a bit of a stupid question, but how do we mask sprite animations? I have an imagesheet setup to provide the frames, then I made the sequence and noticed that as it loops through the frames, I didn’t see a way to mask each one

{
    name="walking",
    start=1,
    count=3,
    time=500,
    loopCount = 0,   
    loopDirection = "forward"    
},

Hi,
I’m not sure I get what you mean.
Is this what you are looking for?

Exactly. I want to apply a mask on to each frame on a sprite animation. And I was confused on how to do this

Okay, I think I might not have been very clear with what I was asking. So, I have a program I’m making where the player character is represented by a sprite object (Solar2D Documentation — API Reference | Libraries | display | newSprite for anyone who isn’t familiar). I followed this tutorial for animating sprite movement (Solar2D Documentation — Developer Guides | Graphics/Audio/Animation). I have a frame sheet set up to draw each frame from. I have a sequence defined (as outlined in the linked tutorial). That part works. I have it set up so that the sprite animation plays when I want it to.

The problem I face is that the sprite has a lot of white space that should be empty. I have used masking in previous projects for similar problems. The difficulty though is that I’m not sure how to apply a mask for each frame when the sequence is playing. I tend to have difficulty as well phrasing things in a clear manner, so if anything I wrote is confusing, I’d be more than happy to clarify. Any help is very appreciated

You mean that your sprite has like a solid white background color that you want to remove?
If that’s the case, then I’d just edit the file to remove the white parts and save it as a png with transparency, so you don’t need masks, shaders and other technics that have a cost in term of resources and perfomances (even if it is a minimum cost).

This might be obvious if you have knowledge of digital drawing, or a completely new thing if you are new to this world, so don’t get me wrong if I’m saying something that for you is obvious and it’s not what you need :sweat_smile:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.