Advertisement
Guest User

Untitled

a guest
May 4th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. e.Graphics.TranslateTransform(Chute1Rect.Width / 2 + Chute1Rect.X, Chute1Rect.Height / 2 + Chute1Rect.Y);
  2.  
  3. if (increasing) //Chute is rotating out of the way
  4. {
  5. e.Graphics.RotateTransform(chuteAngle);
  6.  
  7. e.Graphics.TranslateTransform(-1 * (Chute1Rect.Width / 2 + Chute1Rect.X), -1 * (Chute1Rect.Height / 2 + Chute1Rect.Y));
  8. e.Graphics.DrawImage(ChuteRotating, Chute1Rect);
  9.  
  10. //These statements do not seem to be resetting the graphics drawing by the time we do the trains
  11. e.Graphics.TranslateTransform(Chute1Rect.Width / 2 + Chute1Rect.X, Chute1Rect.Height / 2 + Chute1Rect.Y);
  12. e.Graphics.RotateTransform(0);
  13. }
  14. else //Chute is rotating into load position
  15. {
  16. if (chuteAngle == 0) //Chute has rotated into load position
  17. {
  18. e.Graphics.TranslateTransform(-1 * (Chute1Rect.Width / 2 + Chute1Rect.X), -1 * (Chute1Rect.Height / 2 + Chute1Rect.Y));
  19.  
  20. //Getting here means that the chute can be lifted & lowered because we are rotated down
  21. if (lifting) //Chute is lifting out of the way
  22. {
  23. Chute1SlideRect.Y -= chuteDistance;
  24. Chute2SlideRect.Y -= chuteDistance;
  25.  
  26. e.Graphics.DrawImage(ChuteSlide, Chute1SlideRect);
  27. e.Graphics.DrawImage(ChuteSlide, Chute2SlideRect);
  28. }
  29. else //Chute is lifting into load position
  30. {
  31. Chute1SlideRect.Y -= chuteDistance;
  32. Chute2SlideRect.Y -= chuteDistance;
  33.  
  34. e.Graphics.DrawImage(ChuteSlide, Chute1SlideRect);
  35. e.Graphics.DrawImage(ChuteSlide, Chute2SlideRect);
  36. }
  37.  
  38. e.Graphics.DrawImage(ChuteJoint, Chute1JointRect);
  39. e.Graphics.DrawImage(ChuteJoint, Chute2JointRect);
  40. }
  41. else
  42. {
  43. e.Graphics.RotateTransform(chuteAngle);
  44.  
  45. e.Graphics.TranslateTransform(-1 * (Chute1Rect.Width / 2 + Chute1Rect.X), -1 * (Chute1Rect.Height / 2 + Chute1Rect.Y));
  46. e.Graphics.DrawImage(ChuteRotating, Chute1Rect);
  47.  
  48. //These statements do not seem to be resetting the graphics drawing by the time we do the trains
  49. e.Graphics.TranslateTransform(Chute1Rect.Width / 2 + Chute1Rect.X, Chute1Rect.Height / 2 + Chute1Rect.Y);
  50. e.Graphics.RotateTransform(0);
  51. }
  52. }
  53. //Down below here is where the trains get drawn
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement