UI Mask - Unity Official Tutorials

preview_player
Показать описание
Watch this in context on the Unity Learn pages here -

Masks are used to hide part of a UI Image element. They can be used to define an area to animate images into, or in conjunction with the Scroll Rect component to achieve a scrollable space.

Help us caption & translate this video!

Рекомендации по теме
Комментарии
Автор

This is not a tutorial. Rather an overview. But it helped me to get done what I was working on, which is nice 👍

bugzzisnu
Автор

And you dont say that the element to mask have to be Child of the object that have the mask script... this is just a detail, but i was wondering why this wasn't working for me ^^

flobzitout
Автор

This is awesome for minimaps: you have like the whole ui map, but the mask shows only one part of it, and it scrolls when the player moves around.

holster
Автор

1. This only works for UI masks, not for regular 3D sprite masks (kinda a bug)
2. Image component must be added first, Mask component must be added second (this is a bug)
3. Masked object must be child of the Mask object (intentional?)
4. Alpha value of Mask Image must higher than zero (this is a bug)
5. If your masked object has a custom shader / material - it probably wont get masked (this is a bug)
6. Why are there three different mask components and zero explanation in editor?

This is the quality of Unity built-in tools.

pk
Автор

This video is helpful, but it lacks information on the relationship between the masking object and the objects being masked. E.g., does the masking object mask all of its descendants?

bots_alive
Автор

Thanks, I did not know it needed an Image to Work.

jonathancomeau
Автор

Straight simple and easy. Just what i needed

Kudoshi
Автор

Great for sliding UI panel masks!! Thanks

grantlo
Автор

how can you prewrite your entire script and still eb this unclear?

Cloxygen
Автор

Huge "like" for the "Image element" info. I don't know why that is not a RequireComponent tho'. Without that it is clearly not working.

zeiksz
Автор

Just what I was looking for, thanks!!

mrlowtherman
Автор

OMG It's like listening to the bad guy in Typing of the Dead!

threemoo
Автор

I can't get the scroll rect to work and there is no information linked below

Nicoyutub
Автор

This is great and all, but I wish you would have done the steps - step by step. As someone like myself who is new to unity, so tells me what a mask is and how it works, but doesn't show me what you did to get to that point.

darrylblake
Автор

Using a mask on a world space canvas causes any world geometry to also act as a mask. Using a forward rendering camera, having everything on the UI layer, nothing seems to fix this problem. Can anyone help?

TheGreatRakatan
Автор

Can you use text as a mask instead of using an image?

aFewBitsShort
Автор

Just tried it unity 2019.4, well it is useless followed to letter what u said for little u did parented the childs and boom total distorted image not even masking what it is supposed to do. if u ever answer let me know what's wrong Panel-image mask-mask script UI still showing with distorted corners ????

cxshoppermag
Автор

I am using a beta version unity5.0 20 mask but it can not run on Android phones.Showing a trace of one. Such as scratch paper is the same. Can you tell me why?

nswell
Автор

How can I cull UI layer for a camera I use sometimes in my game for 5 mins. I don't want to turn off the UI element.

uzar
Автор

Yeah element has to be a child obj. Also, what's up with the pixelation? What's the point of shapes if it has a dominant staircase effect?

Throneofliesgame