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 Shankar · May 19, 2013 at 12:56 AM · toggleguistyle

why i'm not geting Toggle symbol when i apply fontstyle(GUIStyle)?

Hi all,

I am making a simple Examination app.

I am suffering simple problem. My Toggle symbol missed in the scene.

My code is like this:

    using UnityEngine;
    using System.Collections;

    public class NewBehaviourScript : MonoBehaviour {
 
 private bool text1;
 public GUIStyle newfont;
 // Use this for initialization
 void Start () {
 
 }
 
 // Update is called once per frame
 void OnGUI () {
 
     GUI.Toggle(new Rect(100,100,100,50),text1,"Hi",newfont);
 }

}

Can i get any solution or any help on that task.

thank you

shankar

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 ExTheSea · May 19, 2013 at 10:13 AM 0
Share

Could you try if maybe this works:

 text1 = GUI.Toggle(new Rect(100,100,100,50),text1,"Hi",newfont);
avatar image Shankar · May 20, 2013 at 03:58 AM 0
Share

No this doesn't work.

avatar image TonyLi · May 20, 2013 at 01:09 PM 0
Share

In the inspector, have you assigned newfont? $$anonymous$$aybe it's set to something that's not visible.

Try:

     GUI.Toggle(new Rect(100, 100, 500, 50), text1, "Hi");

This test will use the default GUI skin & style, and specifies a wider rectangle in case the control is getting cut off.

Try adding a label (GUI.Label). Does the label show up?

I know this is an obvious one, but worth checking: Is the script attached to an active object in the scene?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by ravinjfdskf · May 21, 2013 at 06:21 AM

hey ,If u are using guistyle u must have to use Toggle image to indicate its a toggle button.. so assign image in inspector n ur problem solved..

Comment
Add comment · Show 1 · 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 Shankar · May 21, 2013 at 06:34 AM 0
Share

I have assign toggle image as background of that but that is not at solved. I wrote code by using textures. also. in the texture i added a toggle symbol. that also not working fine.. can i get any script reference.

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

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Projector Toggling - Scripting Problem 1 Answer

Setting render state of a GUI component 1 Answer

Toggle Enabled/Disabled script? 2 Answers

Toggle Movement Help 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