Exemplo n.º 1
0
            public void Draw(GLEx g, int x, int y)
            {
                switch (style)
                {
                case 0:
                    Color oldColor = g.GetColor();
                    g.SetColor(color);
                    float alpha = 0.0f;
                    int   nx    = x + width / 2 - (int)r * 4,
                          ny    = y + height / 2 - (int)r * 4;
                    g.Translate(nx, ny);
                    for (IEnumerator <RectBox> it = list.GetEnumerator(); it.MoveNext();)
                    {
                        RectBox s = it.Current;
                        alpha = alpha + 0.1f;
                        g.SetAlpha(alpha);
                        g.FillOval(s.x, s.y, s.width, s.height);
                    }
                    g.SetAlpha(1.0F);
                    g.Translate(-nx, -ny);
                    g.SetColor(oldColor);
                    break;

                case 1:
                    g.SetLineWidth(10);
                    g.Translate(x, y);
                    g.FillOval(0, 0, width, height, fill.Color);
                    int sa = angle % 360;
                    g.FillArc(x + (width - paintWidth) / 2, y
                              + (height - paintHeight) / 2, paintWidth, paintHeight,
                              sa, sa + ANGLE_STEP, Color.Red);
                    g.Translate(-x, -y);
                    g.ResetLineWidth();
                    break;
                }
            }
Exemplo n.º 2
0
 public override void Draw(GLEx g)
 {
     if (selected)
     {
         g.SetColor(255, 0, 0, 100);
         g.FillOval(-(range * 2 - Field.GetTileWidth()) / 2,
                    -(range * 2 - Field.GetTileHeight()) / 2,
                    this.range * 2 - 1, this.range * 2 - 1);
         g.SetColor(LColor.red);
         g.DrawOval(-(range * 2 - Field.GetTileWidth()) / 2,
                    -(range * 2 - Field.GetTileHeight()) / 2,
                    this.range * 2 - 1, this.range * 2 - 1);
         g.ResetColor();
     }
 }
Exemplo n.º 3
0
 public virtual void CreateUI(GLEx g)
 {
     if (!visible)
     {
         return;
     }
     if (alpha > 0 && alpha < 1)
     {
         g.SetAlpha(alpha);
     }
     for (int i = 0; i < drops.Length; ++i)
     {
         g.FillOval((int)drops[i].x, (int)drops[i].y, 2, 2, color.Color);
     }
     if (alpha > 0 && alpha < 1)
     {
         g.SetAlpha(1);
     }
 }
Exemplo n.º 4
0
        private void Step(GLEx g, CycleProgress e, int index, int frame_0,
                          LColor color_1, float alpha_2)
        {
            switch (stepType)
            {
            case 0:
                g.FillOval(X() + e.x - blockHalfWidth, Y() + e.y - blockHalfHeight,
                           blockWidth, blockHeight);
                break;

            case 1:
                g.FillRect(X() + e.x - blockHalfWidth, Y() + e.y - blockHalfHeight,
                           blockWidth, blockHeight);
                break;

            case 2:
                if (last != null)
                {
                    float[] xs = { X() + last.x, X() + e.x };
                    float[] ys = { Y() + last.y, Y() + e.y };
                    g.DrawPolygon(xs, ys, 2);
                }
                last = e;
                break;

            case 3:
                if (last != null)
                {
                    g.DrawLine(X() + last.x, Y() + last.y, X() + e.x, Y() + e.y);
                }
                last = e;
                break;

            case 4:
                Step(g, e.x, e.y, e.progress, index, frame_0, color_1, alpha_2);
                break;
            }
        }
Exemplo n.º 5
0
            public void Draw(GLEx g, int x, int y)
            {
                LColor oldColor = g.GetColor();

                g.SetColor(color);
                switch (style)
                {
                case 0:
                    float alpha = 0.0f;
                    int   nx    = x + width / 2 - (int)r * 4,
                          ny    = y + height / 2 - (int)r * 4;
                    g.Translate(nx, ny);
                    for (IIterator it = new IteratorAdapter(list.GetEnumerator()); it.HasNext();)
                    {
                        RectBox s = (RectBox)it.Next();
                        alpha = alpha + 0.1f;
                        g.SetAlpha(alpha);
                        g.FillOval(s.x, s.y, s.width, s.height);
                    }
                    g.SetAlpha(1.0F);
                    g.Translate(-nx, -ny);
                    break;

                case 1:
                    g.SetLineWidth(10);
                    g.Translate(x, y);
                    g.SetColor(Fill);
                    g.DrawOval(0, 0, width, height);
                    int sa = angle % 360;
                    g.FillArc(x + (width - paintWidth) / 2, y
                              + (height - paintHeight) / 2, paintWidth, paintHeight,
                              sa, sa + ANGLE_STEP);
                    g.Translate(-x, -y);
                    g.ResetLineWidth();
                    break;
                }
                g.SetColor(oldColor);
            }