Clip decal/texture onto (2d) mesh plane

Hello!

I’m trying to figure out how to put any number of textures or decals on top of my flat circle mesh for a 2d game.

The texture cannot go outside of the edges of the 2d mesh, so I need to find a way to cut or clip my texture correctly depending on where you place it on my 2d mesh.

Here’s an illustration:

illustration

The circle is a flat disc 3d mesh used in my 2d game, and I need to be able to work with any number of decals/textures.

What should I be looking at to create something like this? Maybe some sort of projection or?

Thanks a lot in advance for any hints/pointers!

Projector with ignoreLayers and http://effectronica.com/?p=462 as shader (modified for the "straight alpha blending as written below the shader code in the article) solved my issue.

Thanks everyone who contributed!