Skip to content

Commit 80f52cd

Browse files
committed
Expose DrawQuad as a safe public API for custom rectangles; remove redundant DrawLineCustom; update Stats.cs with example usage.
1 parent 27fe26e commit 80f52cd

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Assets/DebugOverlay/DebugOverlay.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,13 @@ public static void DrawLine(float x1, float y1, float x2, float y2, Color col)
207207
instance.AddLine(x1, y1, x2, y2, col);
208208
}
209209

210+
public static void DrawQuad(float x, float y, float w, float h, Color color)
211+
{
212+
if (instance == null)
213+
return;
214+
instance.AddQuad(x, y, w, h, '\0', color);
215+
}
216+
210217
void _DrawText(float x, float y, ref char[] text, int length)
211218
{
212219
const string hexes = "0123456789ABCDEF";

Assets/Game/Stats.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ public void TickUpdate()
112112
float time = (float)Time.frameCount / 60.0f;
113113
for (var i = 0; i < 10; i++)
114114
DebugOverlay.DrawLine(60, 20, 60 + Mathf.Sin(Mathf.PI*0.2f*i + time) * 8.0f, 20 + Mathf.Cos(Mathf.PI*0.2f*i + time) * 8.0f * ratio, Color.black);
115+
116+
DebugOverlay.DrawQuad(5, 22, 4, 2, Color.magenta);
115117
}
116118

117119
public void Shutdown() { }

0 commit comments

Comments
 (0)