Esempio n. 1
0
        public org.mini2Dx.core.geom.Rectangle peekClip()
        {
            var rect = new org.mini2Dx.core.geom.Rectangle();

            peekClip(rect);
            return(rect);
        }
Esempio n. 2
0
 public MonoGameGraphics(GraphicsDevice graphicsDevice)
 {
     _spriteBatch     = new SpriteBatch(graphicsDevice);
     _graphicsDevice  = graphicsDevice;
     _clipRectangle   = new org.mini2Dx.core.geom.Rectangle(0, 0, getWindowWidth(), getWindowHeight());
     _shapeRenderer   = new MonoGameShapeRenderer(graphicsDevice, (MonoGameColor)_setColor, _spriteBatch);
     _rasterizerState = RasterizerNoClipping;
     _graphicsDevice.ScissorRectangle = new Rectangle();
     _font = Mdx.fonts.defaultFont();
     updateFilter();
 }
Esempio n. 3
0
 public MonoGameGraphics(GraphicsDevice graphicsDevice)
 {
     _spriteBatch     = new SpriteBatch(graphicsDevice);
     _graphicsDevice  = graphicsDevice;
     _translation     = Vector2.Zero;
     _scale           = Vector2.One;
     _rotationCenter  = Vector2.Zero;
     _clipRectangle   = new org.mini2Dx.core.geom.Rectangle(0, 0, getWindowWidth(), getWindowHeight());
     _shapeRenderer   = new MonoGameShapeRenderer(graphicsDevice, (MonoGameColor)_setColor, _spriteBatch, _rotationCenter, _translation, _scale, _tint);
     _rasterizerState = new RasterizerState()
     {
         ScissorTestEnable = false
     };
     _graphicsDevice.ScissorRectangle = new Rectangle();
     _font = Mdx.fonts.defaultFont();
     updateFilter();
 }
Esempio n. 4
0
        public void setClip(org.mini2Dx.core.geom.Rectangle clip)
        {
            _rasterizerState = new RasterizerState()
            {
                ScissorTestEnable = true
            };
            _clipRectangle = clip;
            var rect = _graphicsDevice.ScissorRectangle;

            rect.X      = (int)clip.getX();
            rect.Y      = (int)clip.getY();
            rect.Width  = (int)clip.getWidth();
            rect.Height = (int)clip.getHeight();
            _graphicsDevice.ScissorRectangle = rect;
            if (_beginSpriteBatchCalled)
            {
                flush();
            }
        }
Esempio n. 5
0
        public org.mini2Dx.core.geom.Rectangle removeClip()
        {
            if (_rasterizerState.ScissorTestEnable)
            {
                _rasterizerState = new RasterizerState()
                {
                    ScissorTestEnable = false
                };

                if (_beginSpriteBatchCalled)
                {
                    flush();
                }

                var oldClip = _clipRectangle;
                _clipRectangle = new org.mini2Dx.core.geom.Rectangle(0, 0, getWindowWidth(), getWindowHeight());
                return(oldClip);
            }

            return(_clipRectangle);
        }
Esempio n. 6
0
        public void setClip(org.mini2Dx.core.geom.Rectangle clip)
        {
            if (clip.getX() == 0 && clip.getY() == 0 && clip.getWidth() == getViewportWidth() &&
                clip.getHeight() == getViewportHeight())
            {
                removeClip();
                return;
            }

            var wasClipping = _rasterizerState.ScissorTestEnable;

            if (!_rasterizerState.ScissorTestEnable)
            {
                _rasterizerState = RasterizerClipping;
            }

            _clipRectangle = clip;
            updateClip();
            if (!wasClipping)
            {
                endRendering();
            }
        }
Esempio n. 7
0
 public void peekClip(org.mini2Dx.core.geom.Rectangle rectangle)
 {
     rectangle.setXY(_clipRectangle.getX(), _clipRectangle.getY());
     rectangle.setHeight(_clipRectangle.getHeight());
     rectangle.setWidth(_clipRectangle.getWidth());
 }
Esempio n. 8
0
 public void peekClip(org.mini2Dx.core.geom.Rectangle rectangle)
 {
     throw new System.NotImplementedException();
 }