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)._color; }
internal void draw(SpriteBatch spriteBatch, String str, float targetWidth, int horizontalAlignment, bool wrap, Vector2 position, Microsoft.Xna.Framework.Color renderColor) { var wrapStr = (string)wrapText(str, targetWidth + 1); var strings = wrapStr.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, renderColor, 0, origin, Vector2.One, 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, renderColor, 0, origin, Vector2.One, SpriteEffects.None, 0f); } } }
public MonoGameReadOnlyColor(Microsoft.Xna.Framework.Color color) : base(color) { }
public void setBackgroundColor(Color backgroundColor) { _backgroundColor = ((MonoGameColor)backgroundColor)._color; }
public void setColor(Color color) { _setColor = ((MonoGameColor)color)._color; }