示例#1
0
文件: UI.cs 项目: WildGenie/Libraria
        public override void Render(float Dt)
        {
            if (StateManager.GetTopState() != this)
            {
                return;
            }

            const float Offset = 20;

            NanoVG.DrawRectOutline(Color.DarkGray, 6.0f, Offset, Offset, NanoVG.Width - Offset * 2, NanoVG.Height - Offset * 2);

            NanoVG.DrawText("clacon", 24, TextAlign.TopLeft, DemoGameColor, 100, NanoVG.Height - 200, "Demo Game", ref DemoGameButton);
            NanoVG.DrawText("clacon", 24, TextAlign.TopLeft, ExitColor, 100, NanoVG.Height - 170, "Exit", ref ExitButton);
        }
示例#2
0
        static void RenderUI(float Dt)
        {
            if (!Engine.Running)
            {
                Engine.RenderWindow.Close();
                return;
            }

            Engine.UI?.Render(Dt);
            Console.Render(Dt);

            if (Engine.DrawFPSCounter)
            {
                NanoVG.BeginFrame();
                NanoVG.DrawText("clacon", 12, TextAlign.TopLeft, Color.White, 0, 0, string.Format("FPS: {0} - {1} ms", 1.0f / Dt, Dt));
                NanoVG.DrawText("clacon", 12, TextAlign.TopLeft, Color.White, 0, 12, Camera.GetCurrent().ToString());

                //Camera.GetCurrent().rot

                NanoVG.EndFrame();
            }
        }