Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

hover/onHover style settings

Discussion in 'Immediate Mode GUI (IMGUI)' started by ceteris, Mar 5, 2008.

  1. ceteris

    ceteris

    Joined:
    Feb 9, 2008
    Posts:
    25
    cant seem to get them to work? am coding as follows and then tweaking things in the inspector. the only setting in that category that does seem to work is the 'normal' setting.

    thanks for your help...



    Code (csharp):
    1. void OnGUI()
    2.     {
    3.         messageStyle = GUI.skin.label;
    4.        
    5.         GUILayout.BeginArea (centerRect);
    6.  
    7.         GUILayout.Label(message, messageStyle, new GUILayoutOption[0] );
    8.        
    9.         GUILayout.EndArea();
    10.     }
    11.  
    12.  
     
  2. nafonso

    nafonso

    Joined:
    Aug 10, 2006
    Posts:
    377
    Hi,

    You need to use GUILayout.Box( message, messageStyle ) since Labels do not get any events. From the Label docs:

    Regards,
    Afonso