mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 19:28:49 -04:00
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:
parent
78e30c5bf6
commit
72b8c2ce41
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 |
@ -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,12 +58,12 @@ 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user