Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class GamePage : PhoneApplicationPage
- {
- ContentManager contentManager;
- GameTimer timer;
- SpriteBatch spriteBatch;
- Texture2D texture;
- // UIElementRenderer allows us to draw Silverlight UI into a Texture2D, which we can then draw
- // using SpriteBatch to composite UI on top of our game
- UIElementRenderer uiRenderer;
- public GamePage()
- {
- InitializeComponent();
- // Get the content manager from the application
- contentManager = (Application.Current as App).Content;
- // Create a timer for this page
- timer = new GameTimer();
- timer.UpdateInterval = TimeSpan.FromTicks(333333);
- timer.Update += OnUpdate;
- timer.Draw += OnDraw;
- // We use the LayoutUpdated event in order to handle creation of the UIElementRenderer
- LayoutUpdated += new EventHandler(GamePage_LayoutUpdated);
- texture = contentManager.Load<Texture2D>("paddle_blue");
- }
Add Comment
Please, Sign In to add comment