Search Unity

Does UI Toolkit support special button interaction?

Discussion in 'UI Toolkit' started by YinZuoyu, Aug 31, 2020.

  1. YinZuoyu

    YinZuoyu

    Joined:
    Aug 25, 2015
    Posts:
    44
    I want to have interactions only where there are pixels.

    upload_2020-8-31_10-39-30.png
     
  2. jonathanma_unity

    jonathanma_unity

    Unity Technologies

    Joined:
    Jan 7, 2019
    Posts:
    229
    Hi YinZuoyu,

    To control the interactions of an element you can override the "ContainsPoint" method. However, you will need to do all the calculations to determine if the coordinates are over a pixel or not.
     
  3. YinZuoyu

    YinZuoyu

    Joined:
    Aug 25, 2015
    Posts:
    44
    Thanks.