Fix horizontal meter.

This commit is contained in:
Anna Rose 2023-09-30 17:03:00 -04:00
parent c46ee29caa
commit 9102397c77
2 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ class("Meter").extends(gfx.sprite)
function Meter:init(value, w, h, vertical)
Meter.super.init(self)
self.vertical = vertical or true
self.vertical = vertical
self:setSize(w, h)
self:setZIndex(999)
self:setValue(value)
@ -29,7 +29,7 @@ function Meter:setValue(value)
y = 0
h = self.height
x = 0
w = self.width - playdate.math.lerp(0, self.width, value / 100)
w = playdate.math.lerp(0, self.width, value / 100)
end
gfx.setColor(gfx.kColorWhite)
gfx.fillRect(1, 1, self.width-2, self.height-2)

View File

@ -7,7 +7,7 @@ import "pipmeter"
class("UI", {}).extends(playdate.object)
function UI:init()
self.chargeMeter = Meter(100, 10, 60)
self.chargeMeter = Meter(100, 10, 60, true)
self.healthMeter = Meter(100, 60, 10, false)
self.weaponPowerMeter = PipMeter(0, 4, 4, 4, 3, true)
self:moveTo(359, 199)