private void ProcessGestures(List <GestureSample> gestures) { if (OnGesture != null) { CCRect viewPort = CCDrawManager.ViewPortRect; foreach (GestureSample g in gestures) { CCPoint pos = CCPoint.Zero; CCPoint pos2 = CCPoint.Zero; if (viewPort.ContainsPoint(g.Position.X, g.Position.Y)) { pos = CCDrawManager.ScreenToWorld(g.Position.X, g.Position.Y); } if (viewPort.ContainsPoint(g.Position2.X, g.Position2.Y)) { pos2 = CCDrawManager.ScreenToWorld(g.Position2.X, g.Position2.Y); } CCPoint delta = new CCPoint(g.Delta.X, g.Delta.Y); CCPoint delta2 = new CCPoint(g.Delta2.X, g.Delta2.Y); CCGesture cg = new CCGesture(g.GestureType, g.Timestamp, pos, pos2, delta, delta2); OnGesture(cg); } } }
private void ProcessGestures(List<GestureSample> gestures) { if (OnGesture != null) { CCRect viewPort = CCDrawManager.ViewPortRect; foreach (GestureSample g in gestures) { CCPoint pos = CCPoint.Zero; CCPoint pos2 = CCPoint.Zero; if (viewPort.ContainsPoint(g.Position.X, g.Position.Y)) { pos = CCDrawManager.ScreenToWorld(g.Position.X, g.Position.Y); } if (viewPort.ContainsPoint(g.Position2.X, g.Position2.Y)) { pos2 = CCDrawManager.ScreenToWorld(g.Position2.X, g.Position2.Y); } CCPoint delta = new CCPoint(g.Delta.X, g.Delta.Y); CCPoint delta2 = new CCPoint(g.Delta2.X, g.Delta2.Y); CCGesture cg = new CCGesture(g.GestureType, g.Timestamp, pos, pos2, delta, delta2); OnGesture(cg); } } }