private void internalClearContext(Microsoft.Xna.Framework.Color c, bool depthBufferBit, bool colorBufferBit) { if (depthBufferBit && colorBufferBit) { _graphicsDevice.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, c, _graphicsDevice.Viewport.MaxDepth, 0); } else if (depthBufferBit) { _graphicsDevice.Clear(ClearOptions.DepthBuffer, c, _graphicsDevice.Viewport.MaxDepth, 0); } else if (colorBufferBit) { _graphicsDevice.Clear(ClearOptions.Target, c, _graphicsDevice.Viewport.MaxDepth, 0); } else { _graphicsDevice.Clear(c); } }
public void setColor(Color c) { _color = ((MonoGameColor)c).toMonoGameColor(); }
internal void draw(SpriteBatch spriteBatch, string str, float targetWidth, int horizontalAlignment, bool wrap, Vector2 position, Vector2 scale, Microsoft.Xna.Framework.Color renderColor) { var strings = wrapText(str, targetWidth + 1).Split('\n'); var origin = Vector2.Zero; if ((horizontalAlignment & Align.RIGHT) != 0) { origin.X = _spriteFont.MeasureString(strings[0]).X; position.X += targetWidth; } else if ((horizontalAlignment & Align.CENTER) != 0) { origin.X = (int)(_spriteFont.MeasureString(strings[0]).X / 2); position.X += (int)(targetWidth / 2); } spriteBatch.DrawString(_spriteFont, strings[0], position * scale, renderColor, 0, origin, scale, SpriteEffects.None, 0f); if (wrap) { for (var i = 1; i < strings.Length; i++) { if ((horizontalAlignment & Align.RIGHT) != 0) { origin.X = _spriteFont.MeasureString(strings[i]).X; } else if ((horizontalAlignment & Align.CENTER) != 0) { origin.X = (int)(_spriteFont.MeasureString(strings[i]).X / 2); } position.Y += getLineHeight(); spriteBatch.DrawString(_spriteFont, strings[i], position * scale, renderColor, 0, origin, scale, SpriteEffects.None, 0f); } } }
public void setBackgroundColor(Color backgroundColor) { _backgroundColor = ((MonoGameColor)backgroundColor).toMonoGameColor(); }
public void setColor(Color color) { _setColor = ((MonoGameColor)color).toMonoGameColor(); }
public void setColor(Color color) { _setColor = ((MonoGameColor)color)._color; }
internal void clearGraphicsDevice(Microsoft.Xna.Framework.Color color) { _graphicsDevice.Clear(color); }
public void setColor(Color c) { _color = ((MonoGameColor)c)._color; }