コード例 #1
0
        public override void DrawButton(UIButton b)
        {
            VTex2D bi;

            bi = StateImg(b.State);
            int     fw  = SmallFont.Width(b.Name);
            int     fh  = SmallFont.Height();
            Vector4 col = new Vector4(1, 1, 1, 1 * UISys.AlphaMod);

            switch (b.State)
            {
            case ButState.Norm:
                col = new Vector4(0.6f, 0.6f, 0.6f, 0.6f * UISys.AlphaMod);
                break;

            case ButState.Hover:
                col = new Vector4(0.8f, 0.8f, 0.8f, 0.8f * UISys.AlphaMod);
                break;

            case ButState.Press:
                col   = Vector4.One;
                col.W = col.W * UISys.AlphaMod;
                break;
            }
            VPen.Rect((int)b.WidX, (int)b.WidY, (int)b.WidW, (int)b.WidH, bi, col);
            VFontRenderer.Draw(SmallFont, b.Name, (int)(b.WidX + b.WidW / 2 - (fw / 2)), (int)(b.WidY + (b.WidH) / 2 - (fh / 2)), new Vector4(1, 1, 1, UISys.AlphaMod));
            if (b == UISys.Active)
            {
                VPen.Line(b.WidX, b.WidY + 4, b.WidX + b.WidW, b.WidY + 4, new Vector4(1, 1, 1, 1));
            }
        }
コード例 #2
0
 public override void DrawLine(int x, int y, int x2, int y2, Vector4 col)
 {
     VPen.Line(x, y, x2, y2, col);
 }