Esempio n. 1
0
        private void WindowSizeChanged()
        {
            int width, height;

            SDL.SDL_GetWindowSize(_window, out width, out height);


            _rectangle = FiguresFactory.CreateRectangle(
                width / 2, height / 2, _defaultRotationAngle,
                _offsetFromBorders, width - _offsetFromBorders, _offsetFromBorders, height - _offsetFromBorders,
                width - 300, height - 300
                );
            _trapeze.SetMovementBorders(
                _offsetFromBorders, width - _offsetFromBorders, _offsetFromBorders, height - _offsetFromBorders
                );
            _ellipse.SetMovementBorders(
                _offsetFromBorders, width - _offsetFromBorders, _offsetFromBorders, height - _offsetFromBorders
                );
        }
Esempio n. 2
0
        private void InitializeFigures()
        {
            int width, height;

            SDL.SDL_GetWindowSize(_window, out width, out height);

            _rectangle = FiguresFactory.CreateRectangle(
                width / 2, height / 2, _defaultRotationAngle,
                _offsetFromBorders, width - _offsetFromBorders, _offsetFromBorders, height - _offsetFromBorders,
                width - 300, height - 300
                );
            _trapeze = FiguresFactory.CreateTrapeze(
                115, height / 2 + 15, _defaultRotationAngle,
                _offsetFromBorders, width - _offsetFromBorders, _offsetFromBorders, height - _offsetFromBorders,
                200, 100
                );
            _ellipse = FiguresFactory.CreateEllipse(
                width - 100, height / 2, _defaultRotationAngle,
                _offsetFromBorders, width - _offsetFromBorders, _offsetFromBorders, height - _offsetFromBorders,
                100, 57
                );
            _currentFigure = _trapeze;
            PerformClipping();
        }