Search Unity

UI Element - Slider

Discussion in 'UI Toolkit' started by rkp0912, Apr 1, 2020.

  1. rkp0912

    rkp0912

    Joined:
    Feb 17, 2020
    Posts:
    4
    I am a new to unity. Added a sliderInt to the visualelement but, the slider is shown in UI editor but now shown while in Game view.

    This is in UI Editor
    upload_2020-4-1_21-54-40.png

    Where as in game view its is not shown up
    upload_2020-4-1_21-56-23.png

    Here is the UXML and There is USS added for these elements
    <ui:VisualElement name="frame-rate-panel" style="flex-direction: row;&#10;align-items: center;&#10;justify-content: space-between;&#10;margin-left: 3px;&#10;margin-right: 3px;&#10;margin-top: 3px;&#10;margin-bottom: 3px;&#10;">
    <ui:SliderInt picking-mode="Ignore" value="42" high-value="100" name="frame-rate-slider" style="flex-grow: 0;&#10;width: 75%;&#10;background-color: rgba(219, 88, 88, 255);&#10;" />
    <ui:Label text="0 FPS" name="frame-rate" style="width: 25%;&#10;align-items: flex-end;&#10;justify-content: space-between;&#10;-unity-text-align: upper-right;&#10;font-size: 14px;&#10;" />
    </ui:VisualElement>
     
  2. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    SliderInt should work in Game view. Try to see what's wrong using the UIElements Debugger (Window > Analysis > UIElements Debugger). You need to select you Panel from the dropdown at the top-left corner of the debugger window.
     
  3. rkp0912

    rkp0912

    Joined:
    Feb 17, 2020
    Posts:
    4
    I have an observation here, the slider is visible and able to capture the events when I used Default.USS instead of custom USS.