Ejemplo n.º 1
0
        static void DrawScreen()
        {
            DrawEffects(true);

            Raylib.DrawRectangle(0, ScreenHeight - GUIRectHeight, ScreenWidth, GUIRectHeight, GUIPanelColor);
            Raylib.DrawRectangle(0, 0, ScreenWidth, 24, GUIPanelColor);

            if (DebugView)
            {
                float FrameTime = Raylib.GetFrameTime();
                float FPS       = 1.0f / FrameTime;
                Raylib.DrawText(string.Format("{0} / {1} Units, {2:0.000} ms, {3:0.00} FPS", GameUnits.Count(U => U != null), GameUnits.Length, FrameTime, FPS), 2, 2, 20, Color.WHITE);
            }

            string ResourcesText = "R$ " + Resources;
            int    TextWidth     = Raylib.MeasureText(ResourcesText, 20);

            Raylib.DrawText(ResourcesText, ScreenWidth - TextWidth - 10, 2, 20, Color.GREEN);

            int ButtonCount = 0;

            for (int i = 0; i < GameTools.Count; i++)
            {
                GameTool T       = GameTools[i];
                bool     Checked = AddButton(ref ButtonCount, T.Name, T.Active);

                if (Checked && !T.Active)
                {
                    for (int j = 0; j < GameTools.Count; j++)
                    {
                        GameTools[j].Active = false;
                    }

                    T.Active = Checked;
                    T.OnSelected();
                    ActiveGameTool = T;
                }
            }
        }