Beispiel #1
0
 public override void Draw()
 {
     //throw new NotImplementedException();
     spriteSystem.Draw();
     line2DSystem.Draw();
     text2DSystem.Draw();
 }
Beispiel #2
0
        protected override void Draw(GameTime gameTime)
        {
            if (gameTime.TotalGameTime.Seconds > _lastTime)
            {
                _lastTime    = gameTime.TotalGameTime.Seconds;
                frame        = frameCounter;
                frameCounter = 0;
            }
            frameCounter++;


            if (!GameContent.IsLoaded)
            {
                GraphicsDevice.Clear(Color.CornflowerBlue);
                if (GameContent.IsBaseLoaded)
                {
                    var size = GameContent.Font.hudFont.MeasureString("Click on game area to start it!");

                    spriteBatch.Begin();

                    if (!GameContent.IsLoaded)
                    {
                        spriteBatch.DrawString(GameContent.Font.hudFont,
                                               "Zelda is loading: " + GameContent.Counter + " / " + GameContent.Max,
                                               new Vector2(20, 440 - size.Y - 10),
                                               Color.White,
                                               0f,
                                               Vector2.Zero,
                                               .5f,
                                               SpriteEffects.None,
                                               1f);
                        //spriteBatch.Draw(GameContent.Texture.Pixel, new Rectangle(20, 440, (int)(760 * (GameContent.Counter / (float)GameContent.Max)), 20), Color.White);
                    }

                    spriteBatch.End();
                }

                base.Draw(gameTime);
                return;
            }

            GraphicsDevice.Clear(Color.IndianRed);

            spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend, SamplerState.PointClamp);

            SpriteSystem.Draw(spriteBatch);   // Draw all Sprite components
            ColliderSystem.Draw(spriteBatch); // Draw all Collider debug boxes
            TextSystem.Draw(spriteBatch);     // Draw all Text components

            if (LevelManager.showFPS)
            {
                DrawShadowedString(GameContent.Font.hudFont, "FPS: " + frame, new Vector2(440f, 20f), Color.Yellow);
            }

            spriteBatch.End();

            base.Draw(gameTime);
        }
Beispiel #3
0
 public override void Draw()
 {
     text2DSystem.Draw();
     spriteSystem.Draw();
 }