Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Is there a way to add a mask?

Discussion in 'UI Toolkit' started by UserNobody, Mar 24, 2021.

  1. UserNobody

    UserNobody

    Joined:
    Oct 3, 2019
    Posts:
    144
    Hello there,
    I ran into an issue where an element when goes outside the container overlaps with other elements.
    upload_2021-3-24_19-42-0.png
    Is there a way to add a mask to a container or set a z-index so that the toolbar on the left would be on the top?
    The way the layout is done I can't change the order in which these elements are drawn in .uxml file.
     
  2. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    567
    Yes, you will need to set the overflow to hidden on your content container. It should do what you have in mind : restrict the content to the content container. The scrollbar is outside the content container, So it won't be affected.

    Don't hesitate to share more detail if you want more specific answer :)