From 9102397c77705ed9d33c701c0ba79547bd4fe7bb Mon Sep 17 00:00:00 2001 From: annabunches Date: Sat, 30 Sep 2023 17:03:00 -0400 Subject: [PATCH] Fix horizontal meter. --- src/meter.lua | 4 ++-- src/ui.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/meter.lua b/src/meter.lua index d790e2c..ca7cb19 100644 --- a/src/meter.lua +++ b/src/meter.lua @@ -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) diff --git a/src/ui.lua b/src/ui.lua index 8782947..335875e 100644 --- a/src/ui.lua +++ b/src/ui.lua @@ -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)