// Sprite s; public override void Draw() { // if (s == null) { /* * s = new Sprite("textures/backgrounds/paris/paris"); * s.Initialize(BaseGame.Get.Content); * s.CreateFramesFromXML("textures/backgrounds/paris/paris_frames"); * s.CurrentFrame = "rawbg"; * s.ResetDimensions();*/ } BaseGame.Get.GraphicsDevice.Clear(Color.Black); for (int i = 0; i < lsScreens.Count; i++) { Screen screen = lsScreens[i]; if (!screen.CheckFlag(Flags.PASSRENDER) && screen.Initialized) { Camera.CurrentCamera = screen.screenCamera; BaseGame.Get.Begin(); screen.Draw(); //s.Draw(); BaseGame.Get.End(); Camera.CurrentCamera = null; } } base.Draw(); }
public override void Update(GameTime dt) { for (int i = 0; i < lsScreens.Count; i++) { Screen screen = lsScreens[i]; if (!screen.CheckFlag(Flags.PASSUPDATE) && screen.Initialized) { Camera.CurrentCamera = screen.screenCamera; screen.screenCamera.Update(dt); screen.Update(dt); Camera.CurrentCamera = null; } } for (int i = 0; i < lsScreens.Count; i++) { if (lsScreens[i].CheckFlag(Flags.DELETE)) { lsScreens[i].UnloadContent(); EventManager.Get.SendEvent(new ScreenRemovedEvent(lsScreens[i])); lsScreens.RemoveAt(i); --i; } } base.Update(dt); }