New hearts (#567)

* Redesign heart icons

* Fix indentation

* Fix indentation again

* Change half heart

* Fix scaling, fix formatting

* Fix formatting?????

* Fix formatting

* Fix Formmamting
This commit is contained in:
careeoki 2024-07-14 13:18:16 -06:00 committed by GitHub
parent 78e30c5bf6
commit 72b8c2ce41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 B

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 385 B

After

Width:  |  Height:  |  Size: 271 B

View File

@ -13,12 +13,12 @@ const GuiComponent = gui.GuiComponent;
const hotbar = @import("hotbar.zig");
pub var window = GuiWindow {
.scale = 0.75,
.scale = 0.5,
.relativePosition = .{
.{ .attachedToWindow = .{.reference = &hotbar.window, .selfAttachmentPoint = .upper, .otherAttachmentPoint = .upper} },
.{ .attachedToWindow = .{.reference = &hotbar.window, .selfAttachmentPoint = .upper, .otherAttachmentPoint = .lower} },
},
.contentSize = Vec2f{128, 16},
.contentSize = Vec2f{160, 20},
.isHud = true,
.showTitleBar = false,
.hasBackground = false,
@ -49,7 +49,7 @@ pub fn render() void {
while(health < main.game.Player.maxHealth) : (health += 1) {
if(x >= window.contentSize[0]) {
x = 0;
y += 16;
y += 20;
}
if(health + 1 <= main.game.Player.health) {
heartTexture.bindTo(0);
@ -58,10 +58,10 @@ pub fn render() void {
} else {
deadHeartTexture.bindTo(0);
}
draw.boundImage(Vec2f{x, window.contentSize[1] - y - 16}, .{16, 16});
x += 16;
draw.boundImage(Vec2f{x, window.contentSize[1] - y - 20}, .{20, 20});
x += 20;
}
y += 16;
y += 20;
if(y != window.contentSize[1]) {
window.contentSize[1] = y;
gui.updateWindowPositions();