pryamougolnique help
Co-authored-by: Ivan Yuriev <ivanyr44@gmail.com>
This commit is contained in:
parent
70e0c52d59
commit
e700045c47
@ -1,5 +1,6 @@
|
||||
local Vec3 = require "lib.utils.vec3"
|
||||
local ui = require "lib.ui.core"
|
||||
local controls = require "lib.controls"
|
||||
|
||||
--- @type 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
|
||||
and my > self.origin.y and my < self.origin.y + self.size.y
|
||||
then
|
||||
if controls:isJustPressed("select") then
|
||||
controls:consume("select")
|
||||
end
|
||||
self.color = { 0, 1, 0 }
|
||||
else
|
||||
self.color = { 1, 0, 0 }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user