Search Unity

Unity UI Outlining a custom shape?

Discussion in 'UGUI & TextMesh Pro' started by Josiah_Ironclad, Oct 18, 2019.

  1. Josiah_Ironclad

    Josiah_Ironclad

    Joined:
    Sep 24, 2019
    Posts:
    156
    This is currently just a logic and theoretical question, so don't feel the need to provide code or anything similar.

    Anyway. Let's say you have a single static background image, for example a map or a street view type thing. And when you hover over a certain area of the map (like a park or city), or a certain building in the street view, that specific thing/area highlights.

    Here's a crappy example with a Google Map of Switzerland:

    Not hovering over Switzerland
    upload_2019-10-18_0-44-47.png

    Hovering over Switzerland
    upload_2019-10-18_0-54-47.png

    The only times I've seen this done was in some old point and click flash games. And I'm just curious as to how something like this could be made in Unity.

    P.S. When I played those flash games, the highlight/outline would always appear as the mouse is over that shape's outer edge. So not only was a custom shape being displayed, but was also being checked for mouse hover (as opposed to just having a square or circle button or collider in the center that displays a custom image).
     
    Last edited: Oct 18, 2019