- Home /
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:
What would I need to do to get the similar effect?
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?
String.PadLeft() doesn't work..... is that for C#? I'm doing UnityScript
String.PadLeft is .NET, it's not any specific language. It works fine with Unityscript.
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.
Did you even try the answer I wrote? It does exactly what you asked for.
Answer by Eric5h5 · Nov 30, 2010 at 01:34 AM
var num = 123;
Debug.Log (num.ToString("000000"));