public void Draw(GameTime gameTime) { m_gameStateManager[1].Draw(gameTime); m_forms.Draw(); }
/// <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) { graphics.GraphicsDevice.Clear(Color.Black); FormCollection.Render(); //Draw the form collection GraphicsDevice.DepthStencilState = DepthStencilState.DepthRead; base.Draw(gameTime); FormCollection.Draw(); #region dati di debug //Vector2 mousePosition = new Vector2(Mouse.GetState().X, Mouse.GetState().Y); //System.Text.StringBuilder buffer = new System.Text.StringBuilder(); //CubicalCamera camera = (CubicalCamera)BaseCamera.ActiveCamera; //if (camera == null) return; //buffer.AppendFormat("Floor = {0}\n", camera.Floor); //buffer.AppendFormat("X = {0}\n", camera.finalPosition.X / camera.step); //buffer.AppendFormat("Y = {0}\n", camera.finalPosition.Y / camera.step); //buffer.AppendFormat("Z = {0}\n", camera.finalPosition.Z / camera.step); //buffer.AppendFormat("Mouse = {0} {1}\n", mousePosition.X, mousePosition.Y); //buffer.AppendFormat("View =\n| {0} {1} {2} {3} |\n", // BaseCamera.ActiveCamera.View.M11, // BaseCamera.ActiveCamera.View.M12, // BaseCamera.ActiveCamera.View.M13, // BaseCamera.ActiveCamera.View.M14); //buffer.AppendFormat("| {0} {1} {2} {3} |\n", // BaseCamera.ActiveCamera.View.M21, // BaseCamera.ActiveCamera.View.M22, // BaseCamera.ActiveCamera.View.M23, // BaseCamera.ActiveCamera.View.M24); //buffer.AppendFormat("| {0} {1} {2} {3} |\n", // BaseCamera.ActiveCamera.View.M31, // BaseCamera.ActiveCamera.View.M32, // BaseCamera.ActiveCamera.View.M33, // BaseCamera.ActiveCamera.View.M34); //buffer.AppendFormat("| {0} {1} {2} {3} |\n", // BaseCamera.ActiveCamera.View.M41, // BaseCamera.ActiveCamera.View.M42, // BaseCamera.ActiveCamera.View.M43, // BaseCamera.ActiveCamera.View.M44); //Vector3 cameraPos = GraphicsDevice.Viewport.Unproject( // BaseCamera.ActiveCamera.View.Translation, // BaseCamera.ActiveCamera.Projection, // BaseCamera.ActiveCamera.View, // Matrix.Identity); //buffer.AppendFormat("View.Translation: {0},{1},{2} \n", // BaseCamera.ActiveCamera.View.Translation.X, // BaseCamera.ActiveCamera.View.Translation.Y, // BaseCamera.ActiveCamera.View.Translation.Z // ); //buffer.AppendFormat("View.Translation Unprojected: {0},{1},{2} \n", // cameraPos.X, // cameraPos.Y, // cameraPos.Z //); //Vector3 translationReproj = GraphicsDevice.Viewport.Project( // cameraPos, // BaseCamera.ActiveCamera.Projection, // BaseCamera.ActiveCamera.View, // Matrix.Identity // ); //buffer.AppendFormat("View.Translation Reprojected: {0},{1},{2} \n", // translationReproj.X, // translationReproj.Y, // translationReproj.Z // ); //spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Deferred, SaveStateMode.SaveState); //spriteBatch.DrawString(spriteFont, buffer.ToString(), fontPos, Color.Yellow); //spriteBatch.End(); #endregion }