public float DrawString( SpriteBatch batch, CharSourceUnion charSource, Vector2 pos, ColorSourceUnion colorSource ) => DrawString(batch: batch, charSource: charSource, pos: pos, colorSource: colorSource, scale: Vector2.One);
public float DrawString(SpriteBatch batch, CharSourceUnion charSource, Vector2 pos, ColorSourceUnion colorSource, Vector2 scale, float depth = 0f) { _fontSystem.Scale = scale; float result; if (charSource.IsStringSource && colorSource.IsColor) { result = _fontSystem.DrawText( batch: batch, x: pos.X, y: pos.Y, str: charSource.String, color: colorSource.Color, depth: depth ); } else if (charSource.IsStringSource && colorSource.IsGlyphColors) { result = _fontSystem.DrawText( batch: batch, x: pos.X, y: pos.Y, str: charSource.String, glyphColors: colorSource.GlyphColors, depth: depth ); } else if (charSource.IsStringBuilderSource && colorSource.IsColor) { result = _fontSystem.DrawText( batch: batch, x: pos.X, y: pos.Y, str: charSource.StringBuilder, color: colorSource.Color, depth: depth ); } else if (charSource.IsStringBuilderSource && colorSource.IsGlyphColors) { result = _fontSystem.DrawText( batch: batch, x: pos.X, y: pos.Y, str: charSource.StringBuilder, glyphColors: colorSource.GlyphColors, depth: depth ); } else { throw new ArgumentException("char source is invalid state", "charSource"); } _fontSystem.Scale = Vector2.One; return(result); }