A camera for a 2D scene. Initial source from: http://www.david-amador.com/2009/10/xna-camera-2d-with-zoom-and-rotation/
示例#1
0
 public DynamicMap(IServiceProvider serviceProvider, Camera2D camera, GraphicsDevice gd)
 {
     this.content = new ContentManager(serviceProvider, "Content");
     this.levelFactory = new LevelFactory(serviceProvider, this,gd);
     this.player = new Player(Content, new Vector2(), this);
     this.camera = new TrackingDirector(camera, Player);
     this.existingLevels = new Dictionary<string, Level>();
 }
示例#2
0
        public PanningDirector(Camera2D camera, ICameraTrackable panTo, float travelTimeS)
            : base(camera)
        {
            target = panTo;
            this.travelTimeS = travelTimeS;
            ReturnTimeS = travelTimeS;

            origin = camera.Position;
            elapsedTimeS = 0;
            waiting = true;
            returning = false;
            completed = false;
        }
示例#3
0
 public CameraDirector(Camera2D camera)
 {
     Camera = camera;
 }
示例#4
0
 public TrackingDirector(Camera2D camera, ICameraTrackable target)
     : base(camera)
 {
     this.target = target;
 }