public static void BindCamera(Camera2D camera) { _camera = camera; }
public static void Initialise(InsoGame game) { Matrix projection = Matrix.CreateOrthographicOffCenter(0, game.ScreenWidth, game.ScreenHeight, 0, 0, 1); Matrix halfPixelOffset = Matrix.CreateTranslation(-0.5f, -0.5f, 0); baseEffect = game.Content.Load<Effect>("Effects/Flash"); //customEffect.Parameters["World"].SetValue(Matrix.Identity); //customEffect.Parameters["View"].SetValue(Matrix.Identity); //customEffect.Parameters["Projection"].SetValue(halfPixelOffset * projection); Vector2 focusPoint = new Vector2(Globals.TheGame.ScreenWidth * 0.5f, Globals.TheGame.ScreenHeight * 0.5f); cam_Main = new Camera2D(focusPoint); cam_Main.ScaleToZoom = true; for (int i = 0; i < backgroundZoomLevels.Length; ++i) backgroundZoomLevels[i] = (BaseBgZoom + (float)(i + 1) / (float)backgroundZoomLevels.Length) + ExtraBgZoom; cam_BgBack = new Camera2D(focusPoint); cam_BgBack.ScaleToZoom = true; cam_BgBack.Transform.ScaleUniform = 0.25f; cam_BgBack.Transform.ParentTransform = cam_Main.Transform; cam_BgMiddle = new Camera2D(focusPoint); cam_BgMiddle.ScaleToZoom = true; cam_BgMiddle.Transform.ScaleUniform = 0.5f; cam_BgMiddle.Transform.ParentTransform = cam_Main.Transform; cam_BgFront = new Camera2D(focusPoint); cam_BgFront.ScaleToZoom = true; cam_BgFront.Transform.ScaleUniform = 0.75f; cam_BgFront.Transform.ParentTransform = cam_Main.Transform; UL_Global = new UpdateList(); DL_EarthTiles = new DrawingList(); DL_House = new DrawingList(); DL_GroundItems = new DrawingList(); DL_MiddleGround = new DrawingList(); DL_BgLayers[0] = new DrawingList(); DL_BgLayers[1] = new DrawingList(); DL_BgLayers[2] = new DrawingList(); DL_ItemDrops = new DrawingList(); DL_Foreground = new DrawingList(); DL_Backpackers = new DrawingList(); }