How to mask/clipping a sprite?

RenderMask.zip (401.5 KB)

Here’s my thing wasd to move around, but it’s not in a release ready state and has some issues with window scaling and the texture offsets of the storm texture UVs because I couldn’t figure out a way to make them proportional to window scale (for masking regular sprites it’s probably fine)(if you figure out how to make the UV offsets proportional please tell me!!). Check the render script it has active to see how it’s doing its magic. You can draw sprites in the proper way around the scene and mask off different rendering layers based on the sprite mask shapes. If you have questions I can probably help. You can mask any shape, the snowflake is an example.

Example of snowflake mask (click it to see version with grey background) basically it is using same code as DF fonts I only needed it for the BR game though so it can scale up super big, for regular scenes you could probably just use solid black/white sprites. :slight_smile:

I was making a 2D battle royale game but the engine pausing while minimized/resizing was a deal breaker, and also is currently killing any multiplayer game I wanted to make.

I later or anyone else whenever could make this into a polished general use sprite masking thing.

4 Likes