pryamougolnique help

Co-authored-by: Ivan Yuriev <ivanyr44@gmail.com>
This commit is contained in:
Neckrat 2025-08-21 22:42:53 +03:00
parent 70e0c52d59
commit e700045c47

View File

@ -1,5 +1,6 @@
local Vec3 = require "lib.utils.vec3" local Vec3 = require "lib.utils.vec3"
local ui = require "lib.ui.core" local ui = require "lib.ui.core"
local controls = require "lib.controls"
--- @type Rectangle --- @type Rectangle
local ReactiveRectangle = ui.Rectangle { local ReactiveRectangle = ui.Rectangle {
@ -14,6 +15,9 @@ function ReactiveRectangle:update(dt)
if mx > self.origin.x and mx < self.origin.x + self.size.x if mx > self.origin.x and mx < self.origin.x + self.size.x
and my > self.origin.y and my < self.origin.y + self.size.y and my > self.origin.y and my < self.origin.y + self.size.y
then then
if controls:isJustPressed("select") then
controls:consume("select")
end
self.color = { 0, 1, 0 } self.color = { 0, 1, 0 }
else else
self.color = { 1, 0, 0 } self.color = { 1, 0, 0 }