how do i bind map to camera

Feb 27, 2012 at 8:39 PM
Edited Feb 27, 2012 at 8:59 PM

how do i bind map to a camera plz? i used a tut im getting errors how do i change this to fit the xtile dll

private void CalculateBoundingRectangle()
            if (texture != null)
                rectangle = new Rectangle(0, 0, texture.Width, texture.Height);
                Vector2 leftTop = Vector2.Transform(new Vector2(rectangle.Left, rectangle.Top), Transform);
                Vector2 rightTop = Vector2.Transform(new Vector2(rectangle.Right, rectangle.Top), Transform);
                Vector2 leftBottom = Vector2.Transform(new Vector2(rectangle.Left, rectangle.Bottom), Transform);
                Vector2 rightBottom = Vector2.Transform(new Vector2(rectangle.Right, rectangle.Bottom), Transform);

                Vector2 min = Vector2.Min(Vector2.Min(leftTop, rightTop),
                                  Vector2.Min(leftBottom, rightBottom));
                Vector2 max = Vector2.Max(Vector2.Max(leftTop, rightTop),
                                          Vector2.Max(leftBottom, rightBottom));

                rectangle = new Rectangle((int)min.X, (int)min.Y,
                    (int)(max.X - min.X), (int)(max.Y - min.Y));