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 MobinS · Feb 02, 2012 at 01:25 PM · boolnumber

how to arrange numbers

hi i have some bools named "quest1" , "quest2" , "quest3" &... and they may become true or false during the game... I have a ActiveQuests that shows the number of quests that are true... plus them I have a quest1number , quest2number , quest3number &... that are related to quests... I want to arrang the number by the distance of 60... I mean if the active quests are 2 , and the active ones are Quest1 & Quest3 , make quest1number = 60 & quest3number = 160 .... how should I arrange these number? thnx

Comment
Add comment · Show 4
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 flamy · Feb 02, 2012 at 01:36 PM 0
Share

do you want to arrange them on GUI or something? i dont get your question

avatar image Statement · Feb 02, 2012 at 02:19 PM 1
Share

You probably want to rewrite your question. I don't get it either.

avatar image Tasarran · Feb 02, 2012 at 06:55 PM 1
Share

I read it three times, I still don't understand...

avatar image MobinS · Feb 03, 2012 at 02:16 PM 0
Share

Yeah... sorry for the question... I make them a GUI label... when "quest1" is true , the GUI label will show up ... and the "quest1number" is the height of the label in GUI... I wrote a code to count that how many quests are true ... then I want now to arrange them... if the quest 1 and 3 are true ... make the height of first one(quest1) 60 and the second one (quest3)160 ... etc.

1 Reply

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

Answer by Berenger · Feb 03, 2012 at 04:26 PM

According to your comment, you want to pile down several GUI.Label. Once you know which one you'll display, you can use either GUILayout, which by default is Vertical so it does exactly that, or use a loop and your y will be yStart + increment*offset.

Comment
Add comment · Show 4 · 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 MobinS · Feb 03, 2012 at 06:45 PM 0
Share

so I made a script and it will see that which quest is true... for example 2 & 3 ... so I want this part =>> "make 'quest2number(height)'=60 & 'quest3number(height)'=120..." how should I set this exact part? (can u give me the code or explain the exact thing?)

avatar image Berenger · Feb 03, 2012 at 06:54 PM 0
Share

The point of GUILayout is that you don't specify the height of each element, Unity organize it according to the specification you give it (or the default value if you don't, in your case the defaults ones are ok). Check out that page, everything is in there : http://unity3d.com/support/documentation/ScriptReference/GUILayout.Label.html

avatar image MobinS · Feb 04, 2012 at 11:57 AM 0
Share

this work great... but how can I set the size or X of the labels and button in GUIlayout??

avatar image MobinS · Feb 04, 2012 at 12:04 PM 0
Share

thnx I got it... I used GUILayout.Height() & Width & BeginArea

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

7 People are following this question.

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

Related Questions

bool to int? (false = 0, true = 1) Conversion possible? Or manually set int to 0/1? 2 Answers

how to i increase a number temporally 1 Answer

Accessing quadrant/joystick number when using multiple xbox 360 controllers 1 Answer

Why aren't these numbers going down by 1. 1 Answer

Limit number of bullet on screen c# 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