コード例 #1
0
        public void setClip(float x, float y, float width, float height)
        {
            var rect = new Org.Mini2Dx.Core.Geom.Rectangle();

            rect._init_(x, y, width, height);
            setClip(rect);
        }
コード例 #2
0
        public Org.Mini2Dx.Core.Geom.Rectangle peekClip()
        {
            var rect = new Org.Mini2Dx.Core.Geom.Rectangle();

            rect._init_();
            peekClip(rect);
            return(rect);
        }
コード例 #3
0
 public MonoGameGraphics(GraphicsDevice graphicsDevice)
 {
     _spriteBatch    = new SpriteBatch(graphicsDevice);
     _graphicsDevice = graphicsDevice;
     _clipRectangle  = new Org.Mini2Dx.Core.Geom.Rectangle();
     _clipRectangle._init_(0, 0, getWindowWidth(), getWindowHeight());
     _shapeRenderer   = new MonoGameShapeRenderer(graphicsDevice, (MonoGameColor)_setColor, _spriteBatch);
     _rasterizerState = RasterizerNoClipping;
     _graphicsDevice.ScissorRectangle = new Rectangle();
     _font = Mdx.fonts_.defaultFont();
     updateFilter();
 }
コード例 #4
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();
            }
        }
コード例 #5
0
 public void peekClip(Org.Mini2Dx.Core.Geom.Rectangle rectangle)
 {
     rectangle.setXY(_clipRectangle.getX(), _clipRectangle.getY());
     rectangle.setHeight(_clipRectangle.getHeight());
     rectangle.setWidth(_clipRectangle.getWidth());
 }