public org.mini2Dx.core.geom.Rectangle peekClip() { var rect = new org.mini2Dx.core.geom.Rectangle(); peekClip(rect); return(rect); }
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(); }
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(); }
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(); } }
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); }
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()); }
public void peekClip(org.mini2Dx.core.geom.Rectangle rectangle) { throw new System.NotImplementedException(); }