Esempio n. 1
0
 public override void CreateUI(GLEx g, int x, int y, LComponent component,
         LTexture[] buttonImage)
 {
     if (visible && goalPath != null)
     {
         g.SetLineWidth(lineWidth);
         g.GLBegin(GL.GL_LINE_STRIP);
         g.Draw(goalPath, color);
         g.GLEnd();
         g.ResetLineWidth();
         g.ResetColor();
     }
 }
Esempio n. 2
0
        public virtual void CreateUI(GLEx g)
        {
            if (!isVisible)
            {
                return;
            }

            this.Setup();

            int pointsLength = points.Count;

            CycleProgress point;
            int index;
            int frameD;
            int indexD;

            float size = (pointsLength * this.trailLength);

            for (float i = -1, l = size; ++i < l && !this.stopped; )
            {
                index = (int)(frame + i);
                if (index < pointsLength)
                {
                    point = points[index];
                }
                else
                {
                    point = points[index - pointsLength];
                }
                this.alpha = (i / (l - 1));
                frameD = frame / (pointsLength - 1);
                indexD = (int)alpha;
                if (lineWidth > 0)
                {
                    g.SetLineWidth(lineWidth);
                }
                if (scaleX != 1 || scaleY != 1)
                {
                    g.Scale(scaleX, scaleY);
                }
                if (alpha > 0 && alpha < 1)
                {
                    g.SetAlpha(alpha);
                }
                g.SetColor(color);
                Step(g, point, indexD, frameD, color, alpha);
                g.ResetColor();
                if (alpha > 0 && alpha < 1)
                {
                    g.SetAlpha(1);
                }
                if (lineWidth > 0)
                {
                    g.ResetLineWidth();
                }
                if (scaleX != 1 || scaleY != 1)
                {
                    g.Restore();
                }
            }
        }
Esempio n. 3
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;
     }
 }