Exemple #1
0
 public FotograafHud(GameWorld owner)
     : base(owner)
 {
     Visible         = false;
     NumScreenshots  = 0;
     ScreenShots    = new ScreenShot[5];
 }
Exemple #2
0
 public void AddScreenshot(ScreenShot screenshot)
 {
     if (NumScreenshots < 5)
     {
         ScreenShots[NumScreenshots] = screenshot;
         NumScreenshots++;
     }
 }
Exemple #3
0
        public Camera(GameWorld owner)
            : base(owner)
        {
            Texture             = Content.Load<Texture2D>("Fotograaf/Images/camera");
            Position            = Vector2.Zero;
            Visible             = false;
            _lastZoomAction     = 0;
            _screenshotStream   = new ScreenShot();

            // The gulden snede, coords are relative to the LCD screen center.
            _guldenCoords    = new Vector2[4];
            _guldenCoords[0] = new Vector2(-40, -20);   // Left top
            _guldenCoords[1] = new Vector2( 40, -20);   // Right top
            _guldenCoords[2] = new Vector2( 40,  20);   // Right bottom
            _guldenCoords[3] = new Vector2(-40,  20);   // Left bottom
        }
Exemple #4
0
        public override void Update(GameTime gameTime)
        {
            UpdateCameraPosition();

            if ((_owner as Fotograaf).MapEditor.IsEnabled) return;

            // TODO: delay
            if (!_owner.TrophyScreen.Visible && !_owner.AdviceToCancelInput && Input.IsTakePhotoButtonPressed())
            {
                ScreenShot screenshot       = new ScreenShot();

                screenshot.SamplePosition   = new Vector2(Position.X, Position.Y);
                screenshot.Target           = _screenshotStream.Target;
                screenshot.ZoomLevel        = _screenshotStream.ZoomLevel;
                screenshot.ScreenshotData   = (_owner as Fotograaf).GetScreenShotStill();
                screenshot.PhotoScrore      = CalculateScore();

                (_owner as Fotograaf).Hud.AddScreenshot(screenshot);
                (_owner as Fotograaf).Flash.doFlash();

                AudioFactory.PlayOnce("photoClick");
            }

            if (!_owner.TrophyScreen.Visible && (_lastZoomAction += gameTime.ElapsedGameTime.Milliseconds) > _zoomDelay)
            {
                // TODO: implement time based delay.
                if (!_owner.TrophyScreen.Visible &&Input.IsZoomIn() && _screenshotStream.ZoomLevel > 0.5)
                {
                    _screenshotStream.ZoomLevel -= _zoomStepSize;
                    AudioFactory.PlayOnce("zoom");

                    _lastZoomAction = 0;
                }
                if (Input.IsZoomOut() && _screenshotStream.ZoomLevel < 2)
                {
                    _screenshotStream.ZoomLevel += _zoomStepSize;
                    AudioFactory.PlayOnce("zoom");
                    _lastZoomAction = 0;
                }
            }
        }