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

A simple material design Button. Can't really be improved more than this?

Discussion in 'UGUI & TextMesh Pro' started by DovitItalia, Mar 30, 2021.

  1. DovitItalia

    DovitItalia

    Joined:
    Mar 23, 2020
    Posts:
    50
    I open this thread as it is related to my other one, but is a more generic question about UI and good workflow.

    A basic button for a decent UI system have 5 distinct elements:

    - shadow
    - outline
    - fill color
    - icon
    - text

    I attach a screenshot of how I made them in the UI system. The question is simple: is this the best way to do it? Is it really unavoidable to have 5 drawcall each single button? Beside the fact that using sprites there will never be crisp and nice edges, the main problem of this approach is that the drawcalls will be huge pretty easy in any ui scenario

    Is it possible to have a button (without altering the basic functions of a unity ui button, and with the ability to change dinamically its aspects (text, icon, color)) with one single drawcall? Schermata 2021-03-30 alle 16.35.54.png