Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Loius · Jul 29, 2013 at 07:52 PM · guilayouteditorguilayoutcustom inspectortooltip

Custom Inspector tooltips behaving inconsistently

See video here: http://www.youtube.com/watch?v=IZ3T-Hwx5J8

My custom Inspector's tooltips are behaving very badly. Hovering over an element does not display its tooltip; hovering then moving the mouse to another tooltipped element occasionally does show the tooltip.

Disabling the RepaintAll calls from the Gizmo function animating in the scene view does not fix the issue.

The toggles are created with this function:

public static void DefaultField( ref bool arg, GUIContent label ) { arg = EditorGUILayout.Toggle(label,arg);}

And they are inside this nesting:

 GUILayout.Vertical()
   GUILayout.Horizontal()
     GUILayout.Space(20)
     GUILayout.Vertical()
       toggles
     /
   /
 /

I'm at a loss. Any hints?

Edit: Just tried a simple Editor with only a basic Toggle in it, same result.

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Jamora · Jul 30, 2013 at 08:00 AM 0
Share

I tried this too and had similar results: sometimes they showed up immediately, sometimes after a while, sometimes never.

You could make a TextArea/Field/Label whatever at the bottom of your inspector and show the tooltip there as a quick fix.

avatar image Loius · Jul 30, 2013 at 08:16 AM 0
Share

rrrgh, i have like fifty inspectors

time to make a BetterEditor to extend i guess~~

edit: well, no, that's so much work and definitely not straightforward. tooltips should work all the time, not some of the time; i shouldn't have to make some ridiculous class or create some function I always have to call in every GUI segment to make them work.

avatar image Loius · Jul 30, 2013 at 10:17 PM 0
Share

I made a terrible thing which is horrible but it consistently displays the tooltips...

if you put "ForcedTooltip.CaptureTooltip()" at the end of every single editor @_X

 using UnityEngine;
 using UnityEditor;
 
 public class ForcedTooltip : EditorWindow {
     [$$anonymous$$enuItem("Tools/Enable Forced Tooltip")]
     public static void Enable() {
         ForcedTooltip ft = EditorWindow.GetWindow<ForcedTooltip>();
     }
 
     private static bool hide = true;
     private static string tooltip = "";
     public static string Tooltip { 
         set { 
             tooltip = value;
             if ( !hide ) {
                 ForcedTooltip ft = EditorWindow.GetWindow<ForcedTooltip>();
                 float x, y;
                 x = GUI.skin.label.CalcSize(new GUIContent(tooltip,"")).x + 20;
                 y = GUI.skin.label.CalcHeight(new GUIContent(tooltip,""),x) + 45;
                 try {
                     ft.$$anonymous$$Size = new Vector2(x,y);
                     ft.position = new Rect(Screen.currentResolution.width-x,0,x,y);
                     ft.Show();
                 } catch ( System.Exception ) { }
             }
         } }
 
     public static void CaptureTooltip() { if ( GUI.tooltip != "" ) Tooltip = GUI.tooltip; }
 
     private void OnInspectorUpdate() { Repaint(); }
     private void OnGUI() {
         hide=EditorGUILayout.Toggle("Disable Autosizing",hide);
         GUI.skin.label.wordWrap = true;
         GUILayout.Label(tooltip);
         GUI.skin.label.wordWrap = false;
     }
 }
 

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

What is the difference between editorguilayout and guilayout? 1 Answer

How do I prevent "Argument Exception: Getting control 1's position in a group with only 1 controls when doing repaint" in OnGUI function of my CustomPropertyDrawer? 2 Answers

GUI objects (Label and box) change their opacity for unknown reason. 1 Answer

Displaying a tooltip with GUILayout.Window 1 Answer

Best way to offset GUI element from scrollbar in custom inspector? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges