public Camera2D(ResolutionRenderer irr) { IRR = irr; _zoom = 0.1f; _rotation = 0.0f; _position = Vector2.Zero; MinZoom = 0.1f; MaxZoom = 999f; followTarget = null; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { startupPath = Environment.CurrentDirectory; slnDir = startupPath + "\\..\\..\\.."; graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 720; screenInfo.virtualScreenDimensions.X = 1920; screenInfo.virtualScreenDimensions.Y = 1080; // Camera and Independent Resolution Renderer Setup irr = new ResolutionRenderer(this, (int)screenInfo.virtualScreenDimensions.X, (int)screenInfo.virtualScreenDimensions.Y, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight); // Move the window. TODO center the window in the users screen System.Windows.Forms.Form form = (System.Windows.Forms.Form)System.Windows.Forms.Control.FromHandle(this.Window.Handle); form.Location = new System.Drawing.Point(0, 0); graphics.ApplyChanges(); screenInfo.curScreenCenter = new Vector2(); //spaceLevel = new Levels.SpaceLevel(Content); //isoLevel = new Levels.IsoLevel(Content); spaceManager = new SpaceManager(); isoManager = new IsoManager(); uiManager = new UI.UIManager(GraphicsDevice, spaceManager, isoManager); // Get current resolution of the viewport screenInfo.screenDimensions.X = GraphicsDevice.Viewport.Width; screenInfo.screenDimensions.Y = GraphicsDevice.Viewport.Height; Globals.gPrimitives.Init(graphics.GraphicsDevice); base.Initialize(); }
public void Initialize(ResolutionRenderer pIrr, ContentManager cm) { irr = pIrr; camera = new Camera2D(irr) { MaxZoom = 2f, MinZoom = 1f, Zoom = 1f }; camera.SetPosition(Vector2.Zero); camera.RecalculateTransformationMatrices(); curLevel = new Levels.SpaceLevel(cm); }
public void Dispose() { IRR = null; }