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

Circular gauges with floating point precision

Discussion in 'Scripting' started by Serge_Billault, Sep 3, 2014.

  1. Serge_Billault

    Serge_Billault

    Joined:
    Aug 26, 2014
    Posts:
    190
    A cheap trick i went with after i saw that there were no rational (direct, proportional to the goal) solution for this kind of thing (with unity i mean) here: https://www.sugarsync.com/pf/D2307301_98582733_612566

    From the get-go you will see that it is possible to get ride of one sprite if you want to, by pushing the 3 remaining parts in a different order depending on the prc to display

     
  2. mehdyga_1

    mehdyga_1

    Joined:
    Oct 30, 2014
    Posts:
    1
    Thanks! :)
     
  3. Serge_Billault

    Serge_Billault

    Joined:
    Aug 26, 2014
    Posts:
    190
    There are terrible ideas I came with in my first years with Unity and this is one of them.
    Absolutely do never use the crap I linked here when starting this thread some ages ago.
    If you really have no other choice, when creating Rad Filled Sprites for IMGUI (they already exist for non-editor UI) prefer something like this:

    The explanations of the IMGUI Rad Filled Sprites is here:
    https://www.linkedin.com/pulse/tutorial-custom-imgui-rad-fill-pie-chart-sprites-serge-billault/

    The Sprite Demo for IMGUI Rad Filled Sprites is in this project:
    https://drive.google.com/file/d/1bxNAZPsvLsKVq9QyCQO2fEaxKmlXaI76/view?usp=sharing

    The Video of what IMGUI Rad Filled Sprites gives is here:
    https://drive.google.com/file/d/1u201fD5oGVbEk0lT1OjtEcIUpkcLIa2M/view?usp=sharing

    The more triangles, the less deformation and more precise you are but 4 are generally sufficients.