Advertisement
Whiplash141

poop

Dec 19th, 2016
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. void GetNumberPixelString() //gets a graphical string from velocity and heading
  2. {
  3. //Velocity Splitting
  4.  
  5. string velocityString = string.Format("{0:000}", shipSpeed);
  6. string altitudeString = string.Format("{0:00000}", altitude);
  7. string headingOrAccelString = "";
  8.  
  9. headingOrAccelString = string.Format("{0:000}", shipAcceleration);
  10.  
  11. DecomposeNumber velocityStruct;
  12. DecomposeNumber headingOrAccelStruct;
  13. DecomposeNumber altitudeStruct;
  14.  
  15. StringRowDecomposition velocityWordStruct = GetPixelsFromNumber("spd");
  16. StringRowDecomposition altitudeWordStruct = GetPixelsFromNumber("alt");
  17. StringRowDecomposition headingOrAccelWordStruct;
  18. if (inGravity)
  19. headingOrAccelWordStruct = GetPixelsFromNumber("acc");
  20. else
  21. headingOrAccelWordStruct = GetPixelsFromNumber("acc");
  22.  
  23.  
  24. StringRowDecomposition space;
  25. space.Row1 = backgroundColor; space.Row2 = backgroundColor; space.Row3 = backgroundColor; space.Row4 = backgroundColor; space.Row5 = backgroundColor;
  26.  
  27. velocityStruct.Hundreds = GetPixelsFromNumber(velocityString.Substring(0, 1));
  28. velocityStruct.Tens = GetPixelsFromNumber(velocityString.Substring(1, 1));
  29. velocityStruct.Ones = GetPixelsFromNumber(velocityString.Substring(2, 1));
  30.  
  31. headingOrAccelStruct.Hundreds = GetPixelsFromNumber(headingOrAccelString.Substring(0, 1));
  32. headingOrAccelStruct.Tens = GetPixelsFromNumber(headingOrAccelString.Substring(1, 1));
  33. headingOrAccelStruct.Ones = GetPixelsFromNumber(headingOrAccelString.Substring(2, 1));
  34.  
  35. List<StringRowDecomposition> headingAndVelocityCharacterList = new List<StringRowDecomposition>()
  36. {
  37. velocityWordStruct, velocityStruct.Hundreds, velocityStruct.Tens, velocityStruct.Ones
  38. };
  39.  
  40. List<StringRowDecomposition> altitudeCharacterList = new List<StringRowDecomposition>();
  41. altitudeCharacterList = new List<StringRowDecomposition>()
  42. {
  43. headingOrAccelWordStruct, headingOrAccelStruct.Hundreds, headingOrAccelStruct.Tens, headingOrAccelStruct.Ones
  44. };
  45.  
  46.  
  47. headingAndVelocityPixelString = ConstructPixelString(headingAndVelocityCharacterList) + "\n\n" + ConstructPixelString(altitudeCharacterList);
  48. altitudePixelString = "";
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement