예제 #1
0
 private void OnPaint(object sender, PaintEventArgs e)
 {
     // Draw all the shapes
     foreach (Shape shape in shapes)
     {
         GraphicsHandler drawhandler = new GraphicsHandler(e);
         drawhandler.Draw(shapes);
     }
 }
예제 #2
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            // is there a reason to clear?
            GraphicsDevice.Clear(Color.Black);
            spriteBatch.Begin();
            _graphicsHandler.Draw(spriteBatch, _logicHandler, _resourceManager);
            spriteBatch.End();

            base.Draw(gameTime);
        }
예제 #3
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            //GraphicsDevice.Clear(Color.Red);

            // we want FrontToBack, this means that higher layer numbers are drawn behind
            spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend);
            //spriteBatch.Begin();
            _graphicsHandler.Draw(spriteBatch, _logicHandler, _resourceManager, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height);
            spriteBatch.End();

            base.Draw(gameTime);
        }