示例#1
0
        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;
        }
示例#2
0
 public ScreenPoint(ScreenPoint point)
     : base(point.ToPoint())
 {
 }
示例#3
0
 public MapPoint(ScreenPoint mapPoint)
     : base((mapPoint / 32).ToPoint())
 {
 }
示例#4
0
        /// <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);
            }
        }
示例#5
0
 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;
 }