Example #1
0
        public void DrawCursor(Texture2D Texture, vec2 Size, float Angle = 0)
        {
            vec2 WorldCord = ScreenToWorldCoord(Input.CurMousePos);

            DrawTextureSmooth.Using(camvec, CameraAspect, Texture);
            RectangleQuad.Draw(GameClass.Graphics, WorldCord, Size, Angle);
        }
Example #2
0
        public void DrawMinimap(vec2 pos, vec2 size, bool ShowCameraBox = true, bool SolidColor = false)
        {
            //vec2 center = pos + vec(-CameraAspect, -1) + new vec2(size.x, size.y) * vec(1.1f, 1.15f);
            vec2 center = pos * vec(2 * CameraAspect, -2) - vec(CameraAspect, -1);

            MinimapQuad.SetupVertices(center - size, center + size, vec(0, 0), vec(1, 1));

            vec2 _size   = size * vec(1, 254f / 245f) * 1.12f;
            vec2 _center = center + _size * vec(.03f, -.06f);

            DrawTextureSmooth.Using(vec(0, 0, 1, 1), CameraAspect, Assets.Minimap);
            RectangleQuad.Draw(GameClass.Graphics, _center, _size);

            if (SolidColor)
            {
                DrawSolid.Using(vec(0, 0, 1, 1), CameraAspect, rgb(0x222222));
                MinimapQuad.Draw(GameClass.Graphics);
            }
            else
            {
                DrawTextureSmooth.Using(vec(0, 0, 1, 1), CameraAspect, Minimap);
                MinimapQuad.Draw(GameClass.Graphics);
            }

            if (ShowCameraBox)
            {
                vec2 cam = CameraPos * size;
                vec2 bl  = center + cam - vec(CameraAspect, 1) * size / CameraZoom;
                vec2 tr  = center + cam + vec(CameraAspect, 1) * size / CameraZoom;
                bl = max(bl, center - size);
                tr = min(tr, center + size);
                DrawSolid.Using(vec(0, 0, 1, 1), CameraAspect, new color(.6f, .6f, .6f, .5f));
                DrawBox(bl, tr, 2f / GameClass.Screen.x);
            }
        }
Example #3
0
        public void DrawArrowCursor()
        {
            vec2 WorldCord = ScreenToWorldCoord(Input.CurMousePos);

            DrawTextureSmooth.Using(camvec, CameraAspect, Assets.Cursor);

            vec2 size = .02f * Assets.Cursor.UnitSize() / CameraZoom;

            RectangleQuad.Draw(GameClass.Graphics, WorldCord + new vec2(size.x, -size.y), size);
        }
Example #4
0
        public static void DrawFullScreen(Texture2D texture)
        {
            float a = 1920f / 1080f;
            var   q = new RectangleQuad();

            q.SetupVertices(new vec2(-a, -1), new vec2(a, 1), vec2.Zero, vec2.Ones);
            q.SetColor(new color(1f, 1f, 1f, 1f));
            DrawTextureSmooth.Using(new vec4(0, 0, 1, 1), ScreenAspect, texture);
            q.Draw(GameClass.Graphics);
        }
Example #5
0
        public void DrawCircleCursor(bool AfterUi)
        {
            if (AfterUi)
            {
                return;
            }

            vec2 WorldCord = ScreenToWorldCoord(Input.CurMousePos);

            DrawTextureSmooth.Using(camvec, CameraAspect, Assets.SelectCircle);
            RectangleQuad.Draw(GameClass.Graphics, WorldCord, SelectSize);

            DrawTextureSmooth.Using(camvec, CameraAspect, Assets.SelectDot);
            RectangleQuad.Draw(GameClass.Graphics, WorldCord, .0075f * vec2.Ones / CameraZoom);
        }
Example #6
0
 static void DrawElement(RectangleQuad e)
 {
     DrawTextureSmooth.Using(vec(0, 0, 1, 1), GameClass.ScreenAspect, e.Texture);
     e.Draw(GameClass.Graphics);
 }