Exemplo n.º 1
0
        public override void Draw(DevicePanel d)
        {
            if (!c1.Selected)
            {
                c1.Transparency = Transparency;
            }
            if (!c2.Selected)
            {
                c2.Transparency = Transparency;
            }
            if (!c3.Selected)
            {
                c3.Transparency = Transparency;
            }
            if (!c4.Selected)
            {
                c4.Transparency = Transparency;
            }
            int cX = Map.Instance.CenterX;
            int cY = Map.Instance.CenterY;
            int x1 = cX + Object.GetInt("x1");
            int x2 = cX + Object.GetInt("x2");
            int y1 = cY + Object.GetInt("y1");
            int y2 = cY + Object.GetInt("y2");

            Color color = Selected ? Color.Blue : Color.MediumTurquoise;

            d.DrawRectangle(x1, y1, x2, y2, Color.FromArgb(50 * Transparency / 0xFF, color));

            d.DrawLine(x1, y1, x2, y1, Color.FromArgb(Transparency, color));
            d.DrawLine(x1, y1, x1, y2, Color.FromArgb(Transparency, color));
            d.DrawLine(x2, y2, x2, y1, Color.FromArgb(Transparency, color));
            d.DrawLine(x2, y2, x1, y2, Color.FromArgb(Transparency, color));

            c1.Draw(d);
            c2.Draw(d);
            c3.Draw(d);
            c4.Draw(d);

            d.DrawText(Image.GetString("Title"), x1 + 7, y1 + 2, 0, Color.FromArgb(Transparency, color), true);
            d.DrawText(Image.GetString("Desc"), x1 + 7, y1 + 14, x2 - x1 - 14, Color.FromArgb(Transparency, color), false);
        }
Exemplo n.º 2
0
        public override void Draw(DevicePanel d)
        {
            if (!c1.Selected)
            {
                c1.Transparency = Transparency;
            }
            if (!c2.Selected)
            {
                c2.Transparency = Transparency;
            }
            if (!c3.Selected)
            {
                c3.Transparency = Transparency;
            }
            if (!c4.Selected)
            {
                c4.Transparency = Transparency;
            }
            int cX = Map.Instance.CenterX;
            int cY = Map.Instance.CenterY;
            int x1 = cX + Object.GetInt("x1");
            int x2 = cX + Object.GetInt("x2");
            int y1 = cY + Object.GetInt("y1");
            int y2 = cY + Object.GetInt("y2");

            Color color = Selected ? Color.Blue : Color.MediumTurquoise;

            d.DrawRectangle(x1, y1, x2, y2, Color.FromArgb(50 * Transparency / 0xFF, color));

            d.DrawLine(x1, y1, x2, y1, Color.FromArgb(Transparency, color));
            d.DrawLine(x1, y1, x1, y2, Color.FromArgb(Transparency, color));
            d.DrawLine(x2, y2, x2, y1, Color.FromArgb(Transparency, color));
            d.DrawLine(x2, y2, x1, y2, Color.FromArgb(Transparency, color));

            c1.Draw(d);
            c2.Draw(d);
            c3.Draw(d);
            c4.Draw(d);

            d.DrawText(Image.GetString("Title"), x1 + 7, y1 + 2, 0, Color.FromArgb(Transparency, color), true);
            d.DrawText(Image.GetString("Desc"), x1 + 7, y1 + 14, x2 - x1 - 14, Color.FromArgb(Transparency, color), false);
        }