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 ChimpKing · Nov 29, 2010 at 05:30 AM · textscoring

How to set your numbers to expand the opposite direction?

In most "Runner Games" like Monster Dash on the iPhone when they display the number of Meters traveled it expands "backwards" (right to left as opposed to left to right). And, that method also has those zeroes showing on the left (until a number replaces it).

It looks something like this:

alt text

What would I need to do to get the similar effect?

Comment
Add comment · Show 7
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 skovacs1 · Nov 29, 2010 at 05:27 PM 0
Share

Opposite direction of what? Backwards as opposed to what? The mention of "those zeroes" (which zeroes?) leads me to guess that you might be asking about left padding a string representation of a number with 0's which can be done with String.PadLeft() for example. Your description leaves a lot to be desired. Perhaps you could rephrase and maybe include some code to indicate what you've tried, what it is doing and what you are trying to get it to do?

avatar image ChimpKing · Nov 30, 2010 at 12:57 AM 0
Share

String.PadLeft() doesn't work..... is that for C#? I'm doing UnityScript

avatar image Eric5h5 · Nov 30, 2010 at 01:34 AM 0
Share

String.PadLeft is .NET, it's not any specific language. It works fine with Unityscript.

avatar image ChimpKing · Nov 30, 2010 at 02:56 AM 0
Share

explained it a little more. don't know what else I can say to describe it. maybe play this game. http://www.kongregate.com/games/raitendo/action-turnip I want to mock there scoring system with the zeros and the score expands to the left.

avatar image Eric5h5 · Nov 30, 2010 at 03:20 AM 0
Share

Did you even try the answer I wrote? It does exactly what you asked for.

Show more comments

1 Reply

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

Answer by Eric5h5 · Nov 30, 2010 at 01:34 AM

var num = 123;
Debug.Log (num.ToString("000000"));
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

No one has followed this question yet.

Related Questions

How can I use special characters (symbols) in GUI.Label " " and so on? 1 Answer

Weird edges on alpha textures with text 1 Answer

Display a Text/GUI on screen when triggerd with Fadein/Fadeout 1 Answer

name changer component 2 Answers

Text field always active 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