Guest User

Untitled

a guest
Apr 19th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. public partial class GamePage : PhoneApplicationPage
  2. {
  3. ContentManager contentManager;
  4. GameTimer timer;
  5. SpriteBatch spriteBatch;
  6. Texture2D texture;
  7. // UIElementRenderer allows us to draw Silverlight UI into a Texture2D, which we can then draw
  8. // using SpriteBatch to composite UI on top of our game
  9. UIElementRenderer uiRenderer;
  10. public GamePage()
  11. {
  12. InitializeComponent();
  13.  
  14. // Get the content manager from the application
  15. contentManager = (Application.Current as App).Content;
  16.  
  17. // Create a timer for this page
  18. timer = new GameTimer();
  19. timer.UpdateInterval = TimeSpan.FromTicks(333333);
  20. timer.Update += OnUpdate;
  21. timer.Draw += OnDraw;
  22.  
  23. // We use the LayoutUpdated event in order to handle creation of the UIElementRenderer
  24. LayoutUpdated += new EventHandler(GamePage_LayoutUpdated);
  25.  
  26. texture = contentManager.Load<Texture2D>("paddle_blue");
  27.  
  28.  
  29. }
Add Comment
Please, Sign In to add comment