Links: Manual
🐭 This asset is part of the UI Bundle🐭
InverseMask hides anything inside the masked ui area and shows everything outside.
✔ Code & Code-Less options
You don't like foreign code in your project? No problem! Check out the NoCodeDemo in the examples.
✔ Non-destructive
Unlike other masking solutions this one leaves your materials alone. Not extra shaders, no changes to your assets!
✔ URP / HDRP / BuiltIn Support
Works with all render pipelines.
✔ Sprite Mesh shapes
Use any of your images or one of the predefined resolution-independent sprite meshes.
✔ Content and masks can be moved independently
No parent/child depenency in the hierarchy.
✔ Punch as many holes as you like
Automatically merges mask objects into one mask.
✔ Full Source Code
Comments in the code explain everything. Uses assembly definitions to improve compile times.
I publish this template with full source code because as a developer I know how annoying it is to not have source code access. If you like it then please remind others to purchase the plugin. Don't just copy and paste it everywhere. Thank you ❤️
✔ Demos included
Under Assets/Kamgam/InvertedMask/Examples you will find some scenes with examples. You can copy the mask from there.
✔ Supports Unity 2020, 2021, 2022, 2023 / Unity 6, LTS
Please try upgrading to the newest LTS of your Unity release. Unity BETA release are not officially supported (i.e. I am not testing those regularly).
⚠️ ️N O T I C E
The InverseMask uses the same stencil buffer approach as Unitys own UI Mask. Therefore it also does not support soft masks.
Inverse UI masks do not support stacking with Unitys own native UI masks. They are not in conflict, yet if you decide to put an inverse UI mask into a Unity mask it will not be masked by the Unity mask.
⚙️ Installation
Download the Asset and import it into your project.
You are done, no additional setup is needed.
✍️ Usage
Step 1: Create a new empty GameObject.
Step 2: Add the "InvertedMask" Component.
Step 3: Click the "Add Hole" and "Add Content" button.
Step 4: You are done.
☎️ Support
If you have any questions please write to office[at]kamgam.com. Please be patient, replies may take a few days. Please try upgrading to the most recent Unity LTS release and the most recent version of the asset before contacting support. Please include your Asset Store Order Nr in your request.
Hey, if you like this asset then maybe you'll like these too:
One Settings UI + API for all render pipelines.
Skip the hierarchy search. What you click is what you select.
Edit, Rotate, Scale, Snap & Pivot Editor
Fix broken prefabs without losing any changes.