Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Blood Glucose meter

Discussion in 'UGUI & TextMesh Pro' started by brirai, Jan 22, 2016.

  1. brirai

    brirai

    Joined:
    Jul 2, 2013
    Posts:
    6
    Hi

    I am trying to create a blood glucose meter similar to those found on diabetic glucose devices. The aim is to have a UI element with a border that has another image as the filler. This filler should move left and right depending on the current value. Yet I cannot seem to get the layering to work properly. Any help would be appreciated. Most of what I have found online is based around health bars and scaling the X-axis. This doesn't work as we have a bar that has 3 colors on it which follow a linear gradient from left to right.

    Any help would be great
    Thank you
     
  2. DWilliams

    DWilliams

    Joined:
    Jan 12, 2015
    Posts:
    63
    A UI Image can be set to fill mode to allow what you want. Set it to fill horizontal from left or right a certain float value between 0 and 1. I'm not sure what you mean by the layering not working properly. The hierarchy should allow you to layer elements into whatever order you want.