Exemplo n.º 1
0
 public void AddPath(Path p, float px, float py)
 {
     for (IEnumerator<float[]> it = p.localPoints.GetEnumerator(); it.MoveNext(); )
     {
         float[] pos = it.Current;
         if (hole != null)
         {
             hole.Add(new float[] { px + pos[0], py + pos[1] });
         }
         else
         {
             localPoints.Add(new float[] { px + pos[0], py + pos[1] });
         }
     }
     pointsDirty = true;
 }
Exemplo n.º 2
0
		protected internal override void ProcessTouchPressed() {
			int x = Touch.X();
			int y = Touch.Y();
			if (GetCollisionBox().Contains(x, y)) {
				mX = x;
				mY = y;
				if (resetGesture) {
					resetGesture = false;
					if (goalPath != null) {
						goalPath.Clear();
					}
				}
				if (goalPath == null) {
					goalPath = new Path(x, y);
	
				} else {
					goalPath.Set(x, y);
				}
				curveEndX = x;
				curveEndY = y;
				DownClick();
			}
		}
Exemplo n.º 3
0
 public override void Step(GLEx g, float x, float y, float progress,
         int index, int frame_0, LColor color_1, float alpha_2)
 {
     float cx = this.padding + 50, cy = this.padding + 50, angle = (MathUtils.PI / 180)
             * (progress * 360), innerRadius = (index == 1) ? 10
             : 25;
     if (path == null)
     {
         path = new Path(GetX() + x * scale, GetY() + y * scale);
     }
     else
     {
         path.Clear();
         path.Set(GetX() + x * scale, GetY() + y * scale);
     }
     path.LineTo(GetX()
             + ((MathUtils.Cos(angle) * innerRadius) + cx)
             * scale, GetY()
             + ((MathUtils.Sin(angle) * innerRadius) + cy)
             * scale);
     path.Close();
     g.Draw(path);
 }
Exemplo n.º 4
0
 public override void Step(GLEx g, float x, float y, float progress,
         int index, int frame_0, LColor color_1, float alpha_2)
 {
     float cx = this.padding + 50, cy = this.padding + 50, angle = (MathUtils.PI / 180)
             * (progress * 360);
     alpha_2 = MathUtils.Max(0.5f, alpha_2);
     g.SetAlpha(alpha_2);
     if (path == null)
     {
         path = new Path(GetX() + x * scale, GetY() + y * scale);
     }
     else
     {
         path.Clear();
         path.Set(GetX() + x * scale, GetY() + y * scale);
     }
     path.LineTo(GetX() + ((MathUtils.Cos(angle) * 35) + cx)
             * scale, GetY()
             + ((MathUtils.Sin(angle) * 35) + cy) * scale);
     path.Close();
     g.Draw(path);
     if (path == null)
     {
         path = new Path(GetX()
                 + ((MathUtils.Cos(-angle) * 32) + cx) * scale,
                 GetY() + ((MathUtils.Sin(-angle) * 32) + cy)
                         * scale);
     }
     else
     {
         path.Clear();
         path.Set(GetX() + ((MathUtils.Cos(-angle) * 32) + cx)
                 * scale, GetY()
                 + ((MathUtils.Sin(-angle) * 32) + cy) * scale);
     }
     path.LineTo(GetX() + ((MathUtils.Cos(-angle) * 27) + cx)
             * scale, GetY()
             + ((MathUtils.Sin(-angle) * 27) + cy) * scale);
     path.Close();
     g.Draw(path);
     g.SetAlpha(1);
 }
Exemplo n.º 5
0
 public override Shape Transform(Matrix transform)
 {
     Path p = new Path(cx, cy);
     p.localPoints = Transform(localPoints, transform);
     for (int i = 0; i < holes.Count; i++)
     {
         CollectionUtils.Add(p.holes, Transform((List<float[]>)holes[i], transform));
     }
     p.closed = this.closed;
     return p;
 }