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
0
Question by Fabkins · Apr 15, 2012 at 10:42 AM · guiguistyleskinguiskinstyle

Problems controlling the GUI skin / style

I'm having a lot of problems controlling the look of the GUI. Altough I can create a styles from scratch which is ok for some things , I'm often quite happy to use the existing Skin with my own tweaks. And cloning a style and modifying it generally works for me but not for all things.

Questions and Problems I'm facing:

  • I can't seem to turn off the onHover behaviour. I tried modifying the GUI.skin.button.onHover directly. Basically I want to turn onHover off.

  • I can't figure out how certain things are created in the default skin. How do they achieve the round corners? It doesnt seem to be a background image as it scales really well and the corners are always a consistent size.

  • Is it possible to clone the default GUI skin so its a visible entity in the inspector (I'm sure I saw post about this somewhere some time back but cannot find it)

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Lttldude · Apr 15, 2012 at 11:14 AM

1) Make the onHover behavior the same as the onNormal behavior (color and background).

2) The round corners are achieve by the border settings under the button. "Border: Number of pixels on each side of the Background image that are not affected by the scale of the Control' shape"

3) Yea!! You can find them at this link and even edit them in Photoshop or Gimp.

Good Luck.

Comment
Add comment · Show 5 · Share
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 Fabkins · Apr 15, 2012 at 12:57 PM 0
Share

Thanks for the prompt response.

1) I tried:

GUI.skin.button.onHover=GUI.skin.button.onNormal;

I also tried creating a new GUIStyleState without any success. On hover behaviour is inheritted from somewhere or I'm not setting right (highly probable)

2) Oh... there is no mention that they are round ok. I will play with that.

3) Will check out that link.

thanks,

Fab

avatar image Lttldude · Apr 15, 2012 at 01:09 PM 0
Share

1) Create a custom GUI skin. Then you can set the text color and background image for onHover to the same as the onNormal buttons.

2) The border setting only works with backgrounds that already have rounded edges. When you take a look at the file from that link, you'll see what I mean.

avatar image Fabkins · Apr 15, 2012 at 03:36 PM 0
Share

Got other stuff working appart from the first point. No succeeded in making the hover style the same as active.

avatar image Lttldude · Apr 15, 2012 at 06:31 PM 0
Share

No success? Even when creating a new GUI Skin? I just did that on one of my projects and it seemed to work. Hmmm.

avatar image Fabkins · Apr 15, 2012 at 08:03 PM 0
Share

Afraid not. There is something dumb I'm missing for sure just havnt worked out that it is. I thought it was because the nuances between Hover or Active and On and not , but also not.

I've have to move to other things just to keep my sanity. Its bugging the hell out of me now.

Problem is on iOS, the last thing you touch has a hover permantely on. Which means it not obvious what the selection is.

I due course I will redesign my own skin from scratch but its driving me nuts that I cant seem to clone and mod the default skin.

avatar image
0

Answer by JojoJonas · Apr 21, 2012 at 04:05 PM

Figured out the problem. It doesn't make much sense to me, but the window with the white border shows up during GUIStyle.onNormal (didn't really see what .Active and .Focused are used for)

So I did the following:

 GUIStyle style = new GUIStyle(GUI.skin.GetStyle("Window")); //Or whatever
 style.onNormal = style.normal;
 GUI.Window(0, new Rect(windowX, windowY, 600, 450), myWindow, "Menu", style);

and it worked for me! Let me know if it does for you.

Comment
Add comment · Share
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

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

6 People are following this question.

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

Related Questions

Understanding GUISkin/GUIStyle BackgroundImage and Border 2 Answers

Simple GUI Question 1 Answer

How to make a GUI that isnt alpha transparent? 1 Answer

GUIStyle Border Pixels 0 Answers

Automatic new line 1 Answer


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