internal override void AddPhotoData(Photograph pg) { CanTakePhoto = false; RM.PlaySound("snap"); timer = 60; BoundingFrustum bf = new BoundingFrustum(camera.View * camera.ZoomProjection); var entities = island.GetEntitiesInView(bf); Console.WriteLine(entities.Count()); var bird = entities.OfType<Bird>().OrderBy(x => (x.Position - island.player.Position).Length()).FirstOrDefault(); if (bird != null) { pg.Bird = bird; pg.animation = bird.animation; pg.Distance = (bird.Position - island.player.Position).Length(); pg.Splash = entities.OfType<SplashEffect>().Any(); pg.Heading = bird.GetHeading(); pg.Zoom = camera.cameraZoom; Encyclopedia.AddBird(bird); } if (pg.CalculateScore() > HiScore) { HiScore = pg.CalculateScore(); } Console.Write(pg.ToString()); }
protected override void Update(GameTime gameTime) { IM.NewState(); currentScreen.Update(); if (currentScreen.CanTakePhoto && RM.IsDown(InputAction.AltFire) && RM.IsPressed(InputAction.Fire)) { int scale = 2; RenderTarget2D screenshot = new RenderTarget2D(GraphicsDevice, 800 * scale, 600 * scale, false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8); GraphicsDevice.Clear(Color.Black); GraphicsDevice.SetRenderTarget(screenshot); GraphicsDevice.Clear(Color.CornflowerBlue); currentScreen.Draw(); GraphicsDevice.SetRenderTarget(null); Color[] data = new Color[320 * 240 * scale * scale]; screenshot.GetData<Color>(0, new Rectangle(240 * scale, 180 * scale, 320 * scale, 240 * scale), data, 0, data.Length); Texture2D shot = new Texture2D(GraphicsDevice, 320 * scale, 240 * scale); shot.SetData<Color>(data); Photograph pg = new Photograph(shot); photos.Add(pg); screenshot.Dispose(); currentScreen.AddPhotoData(pg); } base.Update(gameTime); }
public PhotoDetailScreen(Photograph photograph, PhotoAlbum photoAlbum) { this.photograph = photograph; this.photoAlbum = photoAlbum; }
public PhotoInfoScreen(Photograph photograph, PhotoAlbum photoAlbum) { this.photograph = photograph; this.photoAlbum = photoAlbum; name = Encyclopedia.GetName(photograph.Bird); }
internal virtual void AddPhotoData(Photograph pg) { }