
February 21st, 2013, 07:03 PM
|
|
Contributing User
|
|
Join Date: Sep 2008
Posts: 117
Time spent in forums: 19 h 33 m 40 sec
Reputation Power: 5
|
|
|
Increase xval as string length decreases
I'm using a custom language and just need a little math help. PHP is close to the language so I figured I'd post here.
--------------------
I'm outputting numbers to a string and everytime the string gets shorter, it moves all the numbers to the left(by 8 pixels).
I need it to keep the same xval.
My custom language allows "strlen" so I just need a formula that reads the string's length and keeps the number's in the same place.
------------------
new len = 8 * strlen(SpeedString);
------------------
Multiplying is incorrect because as the string gets larger is moves it a lot more to the right. Do I div, substract,..I forget.
If you don't understand any of my language, then create the math formula in php.
|