public void CenterOnPoint(ScreenPoint Point) { int prepvaluex = Point.X * -1; prepvaluex += (this.Screen.Width / 2); int prepvaluey = Point.Y * -1; prepvaluey += (this.Screen.Height / 2); Vector2 loc = new Vector2(prepvaluex, prepvaluey); this.MapOffset = loc; }
public ScreenPoint(ScreenPoint point) : base(point.ToPoint()) { }
public MapPoint(ScreenPoint mapPoint) : base((mapPoint / 32).ToPoint()) { }
/// <summary> /// Tweens the camera to a destination starting at the cameras current location /// </summary> /// <param name="endPoint">The ending point that the camera should tween to.</param> /// <param name="time">How long in milliseconds it should take to tween.</param> public void Tween(ScreenPoint endpoint, int time) { TweenEffect effect = new TweenEffect(this, endpoint, time); lock (this.Effects) { this.Effects.Add(effect); } }
public ScreenPoint Offset() { ScreenPoint sp = new ScreenPoint(0,0); sp.X = (int)TileEngine.Camera.MapOffset.X + (int)TileEngine.Camera.CameraOffset.X; sp.Y = (int)TileEngine.Camera.MapOffset.Y + (int)TileEngine.Camera.CameraOffset.Y; return sp; }