Skip to content

Commit 226077e

Browse files
author
Yaroslav Petrichka
authored
Update README.md
1 parent 048ac39 commit 226077e

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
# UIMask
1+
# What is it :mag:
22

33
Reverse Mask of Unity "Mask" component.
44
![mask_test](https://cloud.githubusercontent.com/assets/7010398/10592593/955f4836-76c5-11e5-9262-81b36b241c68.PNG)
55

6-
How to use:
6+
# Usage :computer:
77

8-
1. Download shaders from the provided link
8+
Add a `Mask Inverter` component to the child UI element of the Mask component
99

10-
2. Put them into your project (anywhere would do, but keep in mind your own project hierarchy)
10+
`DreamCode > UI > Mask Inverter`
1111

12-
3. Notice that there are two shaders (UIMask and UIMasked). You need to create two materials (i.e. ReverseMask and ReverseMasked).
12+
![image](https://user-images.githubusercontent.com/7010398/235316659-6f0c5d83-8d86-4a0d-aaaa-baddd7e9d72a.png)
1313

14-
4. Create a new material (ReverseMask) and under "Shader" drop-down menu, select "IndieYP->UIMask". As it's texture, put the texture that you want to be the mask (in my case it was a circle, because I wanted the make a "hole" in the black background).
14+
![image](https://user-images.githubusercontent.com/7010398/235317171-d6d601dd-8f44-4aa9-a9cd-7624fe1cab68.png)
1515

16-
5. Create a new material (ReverseMaked) and under "Shader" drop-down menu, select "IndieYP->UIMasked". Set the color of you material (in my case, black).
16+
# Samples 📖
1717

18-
6. Now you need to assign the materials to your game objects. ReverseMasked goes to the game object that you want to mask (in my case, panel that's serving as a background). ReverseMask goes to game object that's going to do the masking, in my case, image that's set as a child of the mentioned panel (this is very important).
19-
20-
Also, set the same texture (that you used for ReverseMask) as a source image for Image game object.
18+
See `Assets\Examples\Scenes\ExampleScene`

0 commit comments

Comments
 (0)