Fusion.Engine.Graphics.SpriteLayer.DrawDebugString C# (CSharp) Method

DrawDebugString() public method

Draw string using specified font texture, position, text and color. Font texture should contain character glyphs arranged in grid 16x16. Only ASCII is supported.
public DrawDebugString ( Texture fontTexture, float x, float y, string text, Color color, float scale, int clipRectIndex ) : void
fontTexture Texture
x float
y float
text string
color Color
scale float
clipRectIndex int
return void
		public void DrawDebugString(Texture fontTexture, float x, float y, string text, Color color, float scale, int clipRectIndex )
		{
			int len = text.Length;
			var duv = 1.0f / 16.0f;

			for (int i=0; i<len; i++) {
				int ch = text[i];

				var u  = (ch%16)/16.0f;
				var v  = (ch/16)/16.0f;

				DrawUV(fontTexture, x, y, 8 * scale, 8 * scale, color, u, v, duv, duv, clipRectIndex);
				x += 8 * scale;
			}
		}

Same methods

SpriteLayer::DrawDebugString ( Texture fontTexture, float x, float y, string text, Color color, int clipRectIndex ) : void