/// <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.Wheat); myGraphicsObject.BeginWorld(); backGround.Draw(gameTime, myGraphicsObject); myGraphicsObject.End(); this.GameObjectCollection.Draw(gameTime, this.GraphicsObject); }
public void Draw() { if (!testplay) { file.Play("Content\\intro.wav", SoundType.Sound); testplay = true; } bg.Draw(); eff.Draw(); }
protected override void Draw(GameTime gameTime) { switch (currentGameState) { case GameState.Menu: GraphicsDevice.Clear(Color.Black); spriteBatch.Begin(); menu.drawMe(spriteBatch); spriteBatch.End(); break; case GameState.Load: GraphicsDevice.Clear(Color.Black); spriteBatch.Begin(); lblLoading.drawMe(spriteBatch); spriteBatch.End(); break; case GameState.Play: spriteBatch.Begin(); backGround.Draw(spriteBatch); spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, gameManager.Camera.Transform); gameManager.drawMe(spriteBatch, sessionManager); spriteBatch.End(); spriteBatch.Begin(); gameInterface.drawMe(spriteBatch, gameManager); #if DEBUG spriteBatch.DrawString(gameManager.GameWorld.AssetManager.FontLib["DebugFont"], graphics.PreferredBackBufferWidth + "x" + graphics.PreferredBackBufferHeight + "\nFPS:" + (int)(1 / gameTime.ElapsedGameTime.TotalSeconds), Vector2.Zero, Color.White); #endif spriteBatch.End(); break; } base.Draw(gameTime); }
public override void Draw(GameTime gameTime) { if (levelHander.GetGameState == GameLevelHandler.GameState.PLAY) { octreeWorld.GetOctree().ModelsDrawn = 0; explosionHandler.Draw(gameTime, camera); BoundingFrustum cameraFrustrum = new BoundingFrustum(camera.ViewMatrix * camera.ProjectionMatrix); background.Draw(Game.GraphicsDevice, camera); octreeWorld.GetOctree().Draw(camera.ViewMatrix, camera.ProjectionMatrix, cameraFrustrum); city.DrawCity(Game.GraphicsDevice, camera, floorEffect, 0f, new Vector3(0, 0, 0)); //octreeWorld.GetOctree().DrawBoxLines(camera.ViewMatrix, camera.ProjectionMatrix, Game.GraphicsDevice, effect); //city.DrawBoxLines(camera.ViewMatrix, camera.ProjectionMatrix, Game.GraphicsDevice, effect); camera.DrawWeapon(); textHandler.DrawText(((Game1)Game).GetSpriteFont(), ((Game1)Game).GetSpriteBatch(), Game.GraphicsDevice); } base.Draw(gameTime); }
public void draw() { bg.Draw(); }