From 5583ba186e2d104af7c31c7db494f60fb6b52f22 Mon Sep 17 00:00:00 2001 From: pavetr Date: Wed, 2 Sep 2026 17:18:44 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20Lua=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lua-API.md | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/Lua-API.md b/Lua-API.md index 6e2134e..a024d69 100644 --- a/Lua-API.md +++ b/Lua-API.md @@ -209,4 +209,49 @@ tab = fatal.menu_tab("My Script 3") How it looks in game:
-![User view](https://dev.pavetr.ru/uploads/fatal_docs/fatal_menu_interaction.png) \ No newline at end of file +![User view](https://dev.pavetr.ru/uploads/fatal_docs/fatal_menu_interaction.png) + +### ``fatal.draw.line(x1, y1, x2, y2, r, g, b, a, [thickness])`` +### ``fatal.draw.rect(x, y, w, h, r, g, b, a)`` +### ``fatal.draw.rect_filled(x, y, w, h, r, g, b, a)`` +### ``fatal.draw.circle(cx, cy, radius, r, g, b, a, [thickness])`` +### ``fatal.draw.circle_filled(cx, cy, radius, r, g, b, a)`` +### ``fatal.draw.text(x, y, text, r, g, b, a)`` +### ``fatal.draw.clear()`` + +**Example** +```lua +hook.Remove("Think", "fatal_demo_draw") +hook.Add("Think", "fatal_demo_draw", function() +local t = RealTime() + +-- Line: x1, y1, x2, y2, r, g, b, a [, thickness] +fatal.draw.line(100, 100, 500, 300, 1, 0, 0, 1, 2) + +-- Running line +local x = 100 + (t * 60 % 400) +fatal.draw.line(x, 180, x + 80, 180, 0, 1, 0, 0.8, 1) + +-- Rect outline: x, y, w, h, r, g, b, a +fatal.draw.rect(200, 220, 150, 80, 1, 1, 1, 1) + +-- Rect fill +fatal.draw.rect_filled(420, 60, 90, 30, 0.2, 0.6, 1, 0.5) + +-- Circle outline: cx, cy, radius, r, g, b, a [, thickness] +fatal.draw.circle(650, 300, 40, 1, 1, 0, 1, 2) + +-- Circle fill +fatal.draw.circle_filled(720, 200, 15, 0, 1, 0, 0.6) + +-- Text: x, y, text, r, g, b, a +fatal.draw.text(100, 260, "fatal.draw works", 1, 1, 1, 1) + +-- Manually clear buffer (not necessary - it clears by itself) +-- fatal.draw.clear() +end) +``` + +How it looks in game (it's unscreengrabable because draws in overlay): +
+![User view](https://dev.pavetr.ru/uploads/fatal_docs/fatal_draw_overlay.png) \ No newline at end of file