예제 #1
0
파일: Path.cs 프로젝트: wethinkall/LGame
 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;
 }
예제 #2
0
파일: LGesture.cs 프로젝트: keppelcao/LGame
		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();
			}
		}
예제 #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);
 }
예제 #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);
 }
예제 #5
0
파일: Path.cs 프로젝트: wethinkall/LGame
 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;
 }