Esempio n. 1
0
        public override void Draw(UISpriteBatch batch)
        {
            batch.GraphicsDevice.DepthStencilState = DepthStencilState.Default;
            batch.GraphicsDevice.BlendState        = BlendState.NonPremultiplied;
            Camera.ProjectionOrigin = new Vector2(batch.GraphicsDevice.Viewport.Width, batch.GraphicsDevice.Viewport.Height) / 2;
            Scene.Draw(batch.GraphicsDevice);

            batch.DrawString(GameFacade.MainFont.GetNearest(8).Font, (Comp3D?.Sum(x => x.Mesh?.Geoms?.FirstOrDefault()?.Sum(y => y.Value.PrimCount) ?? 0) ?? 0) + " tris", new Vector2(10, 10), Color.Red);
        }
Esempio n. 2
0
        public void Draw(UISpriteBatch SBatch, float FPS)
        {
            mainUI.Draw(SBatch);

            if (TooltipProperties.UpdateDead)
            {
                TooltipProperties.Show = false;
            }
            if (Tooltip != null && TooltipProperties.Show)
            {
                DrawTooltip(SBatch, TooltipProperties.Position, TooltipProperties.Opacity);
            }
            TooltipProperties.UpdateDead = true;

            SBatch.DrawString(m_SprFontBig, "FPS: " + FPS.ToString(), new Vector2(0, 0), Color.Red);
        }
Esempio n. 3
0
        /// <summary>
        /// Draw debug information to the screen.
        /// </summary>
        private void DrawDebug()
        {
            String  hoverTileText = "";
            Vector2 hoverTextSize = new Vector2();

            // Draw hover information
            if (CursorIsOnMap())
            {
                // Draw currently hovered tile coordinates
                hoverTileText = "Hover: (" + PixelToTile(WorldMousePos.ToPoint()).X + ", " + PixelToTile(WorldMousePos.ToPoint()).Y + ")";
                hoverTextSize = Art.Font.MeasureString(hoverTileText);
                UISpriteBatch.DrawString(Art.Font, hoverTileText, new Vector2(ScreenWidth - 5, ScreenHeight - 5) - hoverTextSize, Color.Black);
            }

            String  viewportText     = "Pos: " + ActivePlayer.CenterPoint.X + ", " + ActivePlayer.CenterPoint.Y + ")";
            Vector2 viewportTextSize = Art.Font.MeasureString(viewportText);

            UISpriteBatch.DrawString(Art.Font, viewportText, new Vector2(ScreenWidth - 5, hoverTileText.Length == 0 ? ScreenHeight - 5 : ScreenHeight - 5 - hoverTextSize.Y) - viewportTextSize, Color.Black);
        }
        public void Draw(UISpriteBatch SBatch, float FPS)
        {
            mainUI.Draw(SBatch);

            SBatch.DrawString(m_SprFontBig, "FPS: " + FPS.ToString(), new Vector2(0, 0), Color.Red);
        }