Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void GetNumberPixelString() //gets a graphical string from velocity and heading
- {
- //Velocity Splitting
- string velocityString = string.Format("{0:000}", shipSpeed);
- string altitudeString = string.Format("{0:00000}", altitude);
- string headingOrAccelString = "";
- headingOrAccelString = string.Format("{0:000}", shipAcceleration);
- DecomposeNumber velocityStruct;
- DecomposeNumber headingOrAccelStruct;
- DecomposeNumber altitudeStruct;
- StringRowDecomposition velocityWordStruct = GetPixelsFromNumber("spd");
- StringRowDecomposition altitudeWordStruct = GetPixelsFromNumber("alt");
- StringRowDecomposition headingOrAccelWordStruct;
- if (inGravity)
- headingOrAccelWordStruct = GetPixelsFromNumber("acc");
- else
- headingOrAccelWordStruct = GetPixelsFromNumber("acc");
- StringRowDecomposition space;
- space.Row1 = backgroundColor; space.Row2 = backgroundColor; space.Row3 = backgroundColor; space.Row4 = backgroundColor; space.Row5 = backgroundColor;
- velocityStruct.Hundreds = GetPixelsFromNumber(velocityString.Substring(0, 1));
- velocityStruct.Tens = GetPixelsFromNumber(velocityString.Substring(1, 1));
- velocityStruct.Ones = GetPixelsFromNumber(velocityString.Substring(2, 1));
- headingOrAccelStruct.Hundreds = GetPixelsFromNumber(headingOrAccelString.Substring(0, 1));
- headingOrAccelStruct.Tens = GetPixelsFromNumber(headingOrAccelString.Substring(1, 1));
- headingOrAccelStruct.Ones = GetPixelsFromNumber(headingOrAccelString.Substring(2, 1));
- List<StringRowDecomposition> headingAndVelocityCharacterList = new List<StringRowDecomposition>()
- {
- velocityWordStruct, velocityStruct.Hundreds, velocityStruct.Tens, velocityStruct.Ones
- };
- List<StringRowDecomposition> altitudeCharacterList = new List<StringRowDecomposition>();
- altitudeCharacterList = new List<StringRowDecomposition>()
- {
- headingOrAccelWordStruct, headingOrAccelStruct.Hundreds, headingOrAccelStruct.Tens, headingOrAccelStruct.Ones
- };
- headingAndVelocityPixelString = ConstructPixelString(headingAndVelocityCharacterList) + "\n\n" + ConstructPixelString(altitudeCharacterList);
- altitudePixelString = "";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement