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’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Question Using GUI.Toggle in editor window script how to change the check box position to be on the right?

Discussion in 'Immediate Mode GUI (IMGUI)' started by eshelshlomi1999, May 20, 2023.

  1. eshelshlomi1999


    Apr 1, 2023
    in the screenshot on the left how it is now and on the right is what I mean to put the toggle box the check box on the right side of the string.

    the reason I'm using GUI.Toggle instead GUILayout.Toggle is beacuse I can control on much properties on the toggle that way and that the content text is much closer to the toggle check box.

    now I want to move the check box to be on the right of the string text.

    Code (csharp):
    2. void OnGUI()
    3.     {
    4.         GUILayout.Space(35);
    5.         includeInactive = GUI.Toggle(new Rect(10, 40, 130, 10),includeInactive, " Include Inactive");
    6.     }