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

UIElements USS Transform

Discussion in 'UI Toolkit' started by CrabSchell, Jun 4, 2020.

  1. CrabSchell

    CrabSchell

    Joined:
    May 27, 2014
    Posts:
    9
    I am looking to rotate a label -90 degrees and just started to really poke around the UIElements system. Is there a way to set rotation within the style sheet similar to css (In example: "transform: rotate(-90deg);")?

    I did get it working on the C# side via:

    Code (CSharp):
    1. UnityEngine.UIElements.VisualElement label = new Label("Hello World! ");
    2. label.transform.rotation = Quaternion.Euler(0, 0, -90);
    3. label.transform.position = new Vector3(100, 100, 0);
    4. rootVisualElement.Add(label);
    I could not find anything that indicated that their was support for messing with the transform on the uss side of things (I'm using Unity 2019.3.15 currently).
     
    vovkas, michaelgatesdev and RKar like this.
  2. silenterus

    silenterus

    Joined:
    Nov 8, 2019
    Posts:
    10