public void Draw(SpriteBatch spritebatch) { Vector2 textSize = Miasma.font.MeasureString(text); spritebatch.DrawString(Miasma.font, partialText, position - textSize * .5f, miasmic ? Miasma.MiasmaColor(): Color.White); if (drawExtras != null) { drawExtras(spritebatch, position, textSize, miasmic); } /* * if (sliderPosition != -1) * { * Texture2D bar = Miasma.UISprites[5]; * spritebatch.Draw(bar, position + Vector2.UnitX * (textSize.X * .5f + 20), null, miasmic ? Miasma.MiasmaColor() : Color.White, 0, new Vector2(0, 1.5f), new Vector2(1, 1), SpriteEffects.None, 0); * Texture2D slider = Miasma.UISprites[6]; * spritebatch.Draw(slider, position + Vector2.UnitX * (textSize.X * .5f + 20 + sliderPosition), null, miasmic ? Miasma.MiasmaColor() : Color.White, 0, new Vector2(3.5f, 4.5f), new Vector2(1, 1), SpriteEffects.None, 0); * }*/ }
void ExtraText(SpriteBatch spritebatch, Vector2 position, Vector2 textSize, bool miasmic, String value) { Vector2 mySize = Miasma.font.MeasureString(value); spritebatch.DrawString(Miasma.font, value, (position - mySize * .5f) + (mySize.X * .5f + textSize.X * .5f) * Vector2.UnitX, miasmic ? Miasma.MiasmaColor() : Color.White); }
public override void Draw(SpriteBatch spriteBatch) { Texture2D texture = Miasma.EntitySprites[entityID]; spriteBatch.Draw(texture, Position, null, Miasma.MiasmaColor(), rotation, new Vector2(texture.Width, texture.Height) * .5f, new Vector2(1, 1), SpriteEffects.None, 0); }
void SliderUI(SpriteBatch spritebatch, Vector2 position, Vector2 textSize, bool miasmic, int value) { Texture2D bar = Miasma.UISprites[5]; spritebatch.Draw(bar, position + Vector2.UnitX * (textSize.X * .5f + 20), null, miasmic ? Miasma.MiasmaColor() : Color.White, 0, new Vector2(0, 1.5f), new Vector2(1, 1), SpriteEffects.None, 0); Texture2D slider = Miasma.UISprites[6]; spritebatch.Draw(slider, position + Vector2.UnitX * (textSize.X * .5f + 20 + value), null, miasmic ? Miasma.MiasmaColor() : Color.White, 0, new Vector2(3.5f, 4.5f), new Vector2(1, 1), SpriteEffects.None, 0); }