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. Dismiss Notice

GUI.Toggle problem

Discussion in 'Scripting' started by bbQsauce, Sep 11, 2014.

  1. bbQsauce

    bbQsauce

    Joined:
    Jun 29, 2014
    Posts:
    53
    Hi everyone,
    The problem is that ( after having textures assigned to GUIStyle and GUIContent ) the "thing" at the center doesn't disappear, doesn't matter if active or not. The toggle works, it's just the thing in the middle staying static and not disappearing like it should..
    Like this:



    Does anybody knows why? Or a different thing i could try?

    Thanks in advance

    Code (CSharp):
    1. toggle= GUI.Toggle(new Rect(Screen.width*.15f, Screen.height*.45f, 30, 30), toggle, toggleContent,toggleStyle);
     
  2. ThermalFusion

    ThermalFusion

    Joined:
    May 1, 2011
    Posts:
    906
    Does it look correct if you use the default style with just text conent?
    Have you accidentally assigned a checked image to an unchecked state?
     
  3. bbQsauce

    bbQsauce

    Joined:
    Jun 29, 2014
    Posts:
    53
    Hi thanks for replying, now it works and i don't know why.. i had everything set correctly.. must have been a glitch.. i think
     
    ThermalFusion likes this.