From e84987a80904cffd745132943e522b71bf77184c Mon Sep 17 00:00:00 2001 From: Niko <124378025+happy1063@users.noreply.github.com> Date: Thu, 24 Apr 2025 16:19:51 +0300 Subject: [PATCH] Update malbert.txt --- malbert.txt | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/malbert.txt b/malbert.txt index 52aa5d0..a6ea2b9 100644 --- a/malbert.txt +++ b/malbert.txt @@ -104,8 +104,30 @@ if CLIENT then local f1 = malbert:getScale()[1] local f2 = malbert:getScale()[2] local h = 0 + local MOUSE_DOWN = false + local CLEAR = false local col = Color(h,255,255) + hook.add("InputPressed","MOUSE_DOWN",function(a) + if a == MOUSE.MOUSE1 then + MOUSE_DOWN = true + end + + if a == MOUSE.MOUSE2 then + CLEAR = true + end + end) + + hook.add("InputReleased","MOUSE_DOWN",function(a) + if a == MOUSE.MOUSE1 then + MOUSE_DOWN = false + end + + if a == MOUSE.MOUSE2 then + CLEAR = false + end + end) + hook.add("RenderOffscreen","test",function() local now = timer.systime() if next_frame > now then return end @@ -113,13 +135,17 @@ if CLIENT then render.selectRenderTarget("screenRT") + if CLEAR then + render.clear() + end + local x,y = getCursor() render.setColor(col) render.drawRect(0,0,180,60) - if input.isMouseDown(MOUSE.MOUSE1) then + if MOUSE_DOWN then render.drawRoundedBox(180,x-8*f1,y-8*f2,16*f1,16*f2) end end)