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 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 }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user