This project is read-only.

Camera Control

Jun 4, 2013 at 8:54 PM
I've created a Camera class as well as updated the games code to allow for this.

At the moment the Camera class allows us to move around, zoom and rotate the game screen independant of the tile drawing.

E.g. 0,0 for tile drawing will always be the same place regardless of where the camera is and what rotation is is set to.

I will look into developing this further and eventually converting it to an isometric view
Jun 5, 2013 at 7:14 AM
Edited Jun 5, 2013 at 7:14 AM
I've changed the constructor of Camera() to Camera(int width, heigth) and moved initialization to Initialize() method. Camera now gets (graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeigth / 2) to set center of the screen propperly.

Be advised, after moving the camera around the screen, selecting & moving objects doesn't work propperly (I mean like - it works less, than before moving camera :D ), as their coordinates change.
Jun 11, 2013 at 3:38 PM
Edited Jun 11, 2013 at 3:39 PM
Would we be looking at a camera system that mimics something like AOE?


1) Default 40deg angle using increments of 90degs
2) A handfull of set zoom levels (e.g. 1x, 5x and 10x)

If so, I can look into implementing that and have a basic working version within a few days (or whenever I get chance!)

I've also created a CameraSettings class within Camera.cs to allow quick and easy changes to certain parameters, though at the moment I've only put in Minimum and Maximum zoom amounts.
Jun 11, 2013 at 3:58 PM
I imagine camera more dynamical, ideally smooth zooming in/out and rotating (optional,rotating could be done by increments of Pi/2), bcs XNA frameworks Matrix object seems pretty easy to use.
I'll try to implement WorldObject and MovingObject to be "button-like"(e.g. by inheritance of System.Windows.Forms.ButtonBase or sth like that, I have in plan to analyze this), so we won't have to compute their location due to mouse coordinates, but they'll listen to some events.
Jun 12, 2013 at 9:27 AM
Ok I will look into that then.

In theory the camera should move / rotate independently of object locations, so again in theory an object placed at 0,0 should always be at that location regardless of the camera
Jun 15, 2013 at 1:35 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.