Esempio n. 1
0
        public override void Resized(D2D_SIZE_F size)
        {
            D2D_POINT_2F centerPt = new(
                size.Width / 2,
                size.Height / 2
                );
            D2D_POINT_2F centerPtPlayButton = new(
                _buttonPlayAtariToday.Size.Width / 2,
                _buttonPlayAtariToday.Size.Height / 2
                );

            _titleControl.Location = new(
                centerPt.X - (_titleControl.Size.Width / 2),
                centerPt.Y / 5
                );
            _buttonPlayAtariToday.Location = new(
                centerPt.X - centerPtPlayButton.X,
                centerPt.Y - centerPtPlayButton.Y
                );
            _labelBusyInit.Location = _buttonPlayAtariToday.Location;

            _labelCopyr.Location = new(
                size.Width / 2 - _labelCopyr.Size.Width / 2,
                _buttonPlayAtariToday.Location.Y + _buttonPlayAtariToday.Size.Height + 20
                );
            _labelVers.Location = new(
                size.Width / 2 - _labelVers.Size.Width / 2,
                _labelCopyr.Location.Y + _labelCopyr.Size.Height
                );

            _buttonAbout.Location = new(
                size.Width / 2 - _buttonAbout.Size.Width / 2,
                size.Height - _buttonAbout.Size.Height - 50
                );
        }
 public void ScreenResized(D2D_POINT_2F location, D2D_SIZE_F size)
 {
     _location = location;
     _size     = size;
     _sfx      = size.Width > 0 ? _pitch / size.Width : 0;
     _sfy      = size.Height > 0 ? 230 / size.Height : 0;
 }
Esempio n. 3
0
 public override void Resized(D2D_SIZE_F size)
 {
     _textcontrolAbout.Size = new(
         size.Width - _textcontrolAbout.Location.X * 2,
         size.Height - _textcontrolAbout.Location.Y * 2
         );
 }
Esempio n. 4
0
    public static D2D_SIZE_F SizeF(float width = 0.0f, float height = 0.0f)
    {
        D2D_SIZE_F size = new D2D_SIZE_F {
            width  = width,
            height = height,
        };

        return(size);
    }
 public void ScreenResized(D2D_POINT_2F location, D2D_SIZE_F size)
 {
     _currentXLocation = (int)location.X;
     if (size.Width > 0)
     {
         _currentXWidth = (int)size.Width;
     }
     _startYForPaddleInput = (int)(location.Y + size.Height) * 2 / 3;
 }
Esempio n. 6
0
    public static D2D_MATRIX_3X2_F Scale([NativeTypeName("D2D1_SIZE_F")] D2D_SIZE_F size, [NativeTypeName("D2D1_POINT_2F")] D2D_POINT_2F center = default)
    {
        D2D_MATRIX_3X2_F scale = default;

        scale.m11 = size.width;
        scale.m12 = 0.0f;
        scale.m21 = 0.0f;
        scale.m22 = size.height;
        scale.dx  = center.x - size.width * center.x;
        scale.dy  = center.y - size.height * center.y;

        return(scale);
    }
Esempio n. 7
0
    public static D2D_MATRIX_3X2_F Translation([NativeTypeName("D2D1_SIZE_F")] D2D_SIZE_F size)
    {
        D2D_MATRIX_3X2_F translation = default;

        translation.m11 = 1.0f;
        translation.m12 = 0.0f;
        translation.m21 = 0.0f;
        translation.m22 = 1.0f;
        translation.dx  = size.width;
        translation.dy  = size.height;

        return(translation);
    }
        public override void Resized(D2D_SIZE_F size)
        {
            base.Resized(size);

            _lastResize = size;

            var mult         = Math.Min(size.Width / 4, size.Height / 3);
            var screenWidth  = 4 * mult - 5;
            var screenHeight = 3 * mult - 5;

            var x = size.Width / 2 - screenWidth / 2;
            var y = size.Height / 2 - screenHeight / 2;

            _gameControl.Location = new(x, y);
            _gameControl.Size     = new(screenWidth, screenHeight);

            _hud_buttonClose.Location = new(
                size.Width / 2 - _hud_buttonClose.Size.Width / 2,
                size.Height - 5 - _hud_buttonClose.Size.Height
                );

            _labelInfoText.Location = new(0, size.Height / 2);
            _labelInfoText.Size     = new(size.Width, 200);

            var hudx = size.Width / 2 - (6 * HudButtonWidth + 5 * HudGapX + HudGapX) / 2;

            _hud_buttonPower.Location  = new(hudx, HudStartY);
            _hud_buttonColor.Location  = _hud_buttonPower.ToRightOf(HudGapX, 0);
            _hud_buttonLD.Location     = _hud_buttonColor.ToRightOf(HudGapX, 0);
            _hud_buttonRD.Location     = _hud_buttonLD.ToRightOf(2 * HudGapX, 0);
            _hud_buttonSelect.Location = _hud_buttonRD.ToRightOf(HudGapX, 0);
            _hud_buttonReset.Location  = _hud_buttonSelect.ToRightOf(HudGapX, 0);

            _hud_buttonSound.Location         = new(hudx, 3 * HudStartY);
            _hud_buttonPaused.Location        = _hud_buttonSound.ToRightOf(HudGapX, 0);
            _hud_buttonAntiAliasMode.Location = _hud_buttonPaused.ToRightOf(HudGapX, 0);

            _hud_buttonShowTouchControls.Location = _hud_buttonAntiAliasMode.ToRightOf(2 * HudGapX, 0);
            _hud_buttonInput.Location             = new(_hud_buttonReset.Location.X, 3 * HudStartY);

            var fpsControlsWidth = 3 * _hud_buttonFpsMinus.Size.Width + 3 * _hud_buttonFpsPlus.Size.Width;

            _hud_buttonFpsMinus.Location   = new(size.Width / 2 - fpsControlsWidth / 2, 5 * HudStartY);
            _hud_labelFPS.Location         = _hud_buttonFpsMinus.ToRightOf(50, 0);
            _hud_numbercontrolFPS.Location = _hud_labelFPS.ToRightOf(-5, 0);
            _hud_buttonFpsPlus.Location    = new(size.Width / 2 - fpsControlsWidth / 2 + fpsControlsWidth - _hud_buttonFpsPlus.Size.Width, 5 * HudStartY);

            _hud_controllers.Location = new(0, _hud_buttonClose.Location.Y - 50);
            _hud_controllers.Size     = new(size.Width, 50);

            var touchWidth = (int)_touchbuttonLeft.Size.Width;
            var touchY     = (int)size.Height / 2 - 3 * touchWidth / 2;
            var separation = _settings.TouchControlSeparation;

            // WP8.1 introduced a notification window activated by swiping from the edge.
            // WinX mobile can have navigation buttons occlude a margin on the right.
            // So, keep the touch buttons off of the left and right edge of the screen.
            const int LEFTG = 35, RIGHTG = 35;

            _touchbuttonUp.Location    = new(LEFTG + touchWidth + separation, touchY - separation);
            _touchbuttonLeft.Location  = new(LEFTG + 0, touchY + touchWidth);
            _touchbuttonRight.Location = new(LEFTG + 2 * touchWidth + 2 * separation, touchY + touchWidth);
            _touchbuttonDown.Location  = new(LEFTG + touchWidth + separation, touchY + 2 * touchWidth + separation);
            _touchbuttonFire.Location  = new(size.Width - 2 * touchWidth - separation - RIGHTG, touchY + touchWidth + separation);
            _touchbuttonFire2.Location = new(size.Width - touchWidth - RIGHTG, touchY);

            _isTooNarrowForHud = size.Width < 330f;

            if (_isHudOn && _isTooNarrowForHud)
            {
                HideHud();
            }

            _touchbuttonCollection.IsVisible = !_isTooNarrowForHud && _settings.ShowTouchControls;
            _hud_controlCollection.IsVisible = !_isTooNarrowForHud && _isHudOn;
            _buttonBack.IsVisible            = !_isTooNarrowForHud;
            _buttonSettings.IsVisible        = !_isTooNarrowForHud;

#if PROFILE
            _frameIdleRect     = new(Struct.ToPointF(5, size.Height / 2 - 25), Struct.ToSizeF(25, size.Height / 2));
            _buffersQueuedRect = new(Struct.ToPointF(35, size.Height - 50), Struct.ToSizeF(25, 25));
            _numbercontrolRefreshRate.Location = new(size.Width, size.Height - 50);
#endif
        }
Esempio n. 9
0
 public HRESULT SetViewportSize([NativeTypeName("D2D1_SIZE_F")] D2D_SIZE_F viewportSize)
 {
     return(((delegate * unmanaged <ID2D1SvgDocument *, D2D_SIZE_F, int>)(lpVtbl[4]))((ID2D1SvgDocument *)Unsafe.AsPointer(ref this), viewportSize));
 }
 public HRESULT CreateLayer([NativeTypeName("D2D1_SIZE_F")] D2D_SIZE_F size, ID2D1Layer **layer)
 {
     return(CreateLayer(&size, layer));
 }
 public HRESULT CreateCompatibleRenderTarget([NativeTypeName("D2D1_SIZE_F")] D2D_SIZE_F desiredSize, [NativeTypeName("D2D1_SIZE_U")] D2D_SIZE_U desiredPixelSize, D2D1_PIXEL_FORMAT desiredFormat, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options, ID2D1BitmapRenderTarget **bitmapRenderTarget)
 {
     return(CreateCompatibleRenderTarget(&desiredSize, &desiredPixelSize, &desiredFormat, options, bitmapRenderTarget));
 }
 public HRESULT CreateCompatibleRenderTarget([NativeTypeName("D2D1_SIZE_F")] D2D_SIZE_F desiredSize, [NativeTypeName("D2D1_SIZE_U")] D2D_SIZE_U desiredPixelSize, ID2D1BitmapRenderTarget **bitmapRenderTarget)
 {
     return(CreateCompatibleRenderTarget(&desiredSize, &desiredPixelSize, null, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, bitmapRenderTarget));
 }
Esempio n. 13
0
 public void ScreenResized(D2D_POINT_2F location, D2D_SIZE_F size)
 {
 }
Esempio n. 14
0
 public override void Resized(D2D_SIZE_F size)
 {
     _gameProgramSelectionControl.Size = new(size.Width, size.Height - 100);
 }
 public void Resized(D2D_SIZE_F size)
 {
     _size = size;
     _currentPage.Resized(size);
 }
Esempio n. 16
0
 public HRESULT AddPage(ID2D1CommandList *commandList, D2D_SIZE_F pageSize, IStream *pagePrintTicketStream, [NativeTypeName("D2D1_TAG *")] ulong *tag1 = null, [NativeTypeName("D2D1_TAG *")] ulong *tag2 = null)
 {
     return(((delegate * unmanaged <ID2D1PrintControl *, ID2D1CommandList *, D2D_SIZE_F, IStream *, ulong *, ulong *, int>)(lpVtbl[3]))((ID2D1PrintControl *)Unsafe.AsPointer(ref this), commandList, pageSize, pagePrintTicketStream, tag1, tag2));
 }