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); }
public Org.Mini2Dx.Core.Geom.Rectangle peekClip() { var rect = new Org.Mini2Dx.Core.Geom.Rectangle(); rect._init_(); peekClip(rect); return(rect); }
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(); }
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(); } }
public void peekClip(Org.Mini2Dx.Core.Geom.Rectangle rectangle) { rectangle.setXY(_clipRectangle.getX(), _clipRectangle.getY()); rectangle.setHeight(_clipRectangle.getHeight()); rectangle.setWidth(_clipRectangle.getWidth()); }