mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-09-08 03:29:48 -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");
|
const hotbar = @import("hotbar.zig");
|
||||||
|
|
||||||
pub var window = GuiWindow {
|
pub var window = GuiWindow {
|
||||||
.scale = 0.75,
|
.scale = 0.5,
|
||||||
.relativePosition = .{
|
.relativePosition = .{
|
||||||
.{ .attachedToWindow = .{.reference = &hotbar.window, .selfAttachmentPoint = .upper, .otherAttachmentPoint = .upper} },
|
.{ .attachedToWindow = .{.reference = &hotbar.window, .selfAttachmentPoint = .upper, .otherAttachmentPoint = .upper} },
|
||||||
.{ .attachedToWindow = .{.reference = &hotbar.window, .selfAttachmentPoint = .upper, .otherAttachmentPoint = .lower} },
|
.{ .attachedToWindow = .{.reference = &hotbar.window, .selfAttachmentPoint = .upper, .otherAttachmentPoint = .lower} },
|
||||||
},
|
},
|
||||||
.contentSize = Vec2f{128, 16},
|
.contentSize = Vec2f{160, 20},
|
||||||
.isHud = true,
|
.isHud = true,
|
||||||
.showTitleBar = false,
|
.showTitleBar = false,
|
||||||
.hasBackground = false,
|
.hasBackground = false,
|
||||||
@ -49,7 +49,7 @@ pub fn render() void {
|
|||||||
while(health < main.game.Player.maxHealth) : (health += 1) {
|
while(health < main.game.Player.maxHealth) : (health += 1) {
|
||||||
if(x >= window.contentSize[0]) {
|
if(x >= window.contentSize[0]) {
|
||||||
x = 0;
|
x = 0;
|
||||||
y += 16;
|
y += 20;
|
||||||
}
|
}
|
||||||
if(health + 1 <= main.game.Player.health) {
|
if(health + 1 <= main.game.Player.health) {
|
||||||
heartTexture.bindTo(0);
|
heartTexture.bindTo(0);
|
||||||
@ -58,12 +58,12 @@ pub fn render() void {
|
|||||||
} else {
|
} else {
|
||||||
deadHeartTexture.bindTo(0);
|
deadHeartTexture.bindTo(0);
|
||||||
}
|
}
|
||||||
draw.boundImage(Vec2f{x, window.contentSize[1] - y - 16}, .{16, 16});
|
draw.boundImage(Vec2f{x, window.contentSize[1] - y - 20}, .{20, 20});
|
||||||
x += 16;
|
x += 20;
|
||||||
}
|
}
|
||||||
y += 16;
|
y += 20;
|
||||||
if(y != window.contentSize[1]) {
|
if(y != window.contentSize[1]) {
|
||||||
window.contentSize[1] = y;
|
window.contentSize[1] = y;
|
||||||
gui.updateWindowPositions();
|
gui.updateWindowPositions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user