Skip to content

Commit

Permalink
mobile: InputOverlay reset method
Browse files Browse the repository at this point in the history
  • Loading branch information
polypoyo committed Nov 10, 2024
1 parent 63187dd commit 6298ecd
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/engine/objects/overlay/inputoverlay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ function InputOverlay:init(w,h)
key_down = {},
key_released = {},
}
self:addChild(InputButton("confirm",self.buttons, 540,276, 2))
self:addChild(InputButton("cancel",self.buttons, 510,336, 2))
self:addChild(InputButton("menu",self.buttons, 474,276, 2))
self:reset()
end
function InputOverlay:reset()
for i,v in pairs(self.children) do
v:remove()
end
self.confirm = self:addChild(InputButton("confirm",self.buttons, 540,276, 2))
self.cancel = self:addChild(InputButton("cancel",self.buttons, 510,336, 2))
self.menu = self:addChild(InputButton("menu",self.buttons, 474,276, 2))

self:addChild(Dpad(self.buttons, 10,300))
self.dpad = self:addChild(Dpad(self.buttons, 10,300))
end

return InputOverlay

0 comments on commit 6298ecd

Please sign in to comment.