diff --git a/lib/ui/layout.lua b/lib/ui/layout.lua index 554df3e..537d14b 100644 --- a/lib/ui/layout.lua +++ b/lib/ui/layout.lua @@ -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 }