Fixed alignment of the ability icons on the hud

This commit is contained in:
Sollace 2020-09-24 21:47:49 +02:00
parent d30b22c11c
commit bff01ff787
6 changed files with 5 additions and 5 deletions

View file

@ -79,9 +79,9 @@ class Slot {
} }
// contents // contents
int middle = (slotPadding + size - iconSize)/2; //int middle = (slotPadding + size - iconSize)/2;
uHud.renderAbilityIcon(matrices, stat, middle, middle, iconSize, iconSize, iconSize, iconSize); uHud.renderAbilityIcon(matrices, stat, slotPadding / 2, slotPadding / 2, iconSize, iconSize, iconSize, iconSize);
// foreground // foreground
UHud.drawTexture(matrices, 0, 0, backgroundU, backgroundV, size, size, 128, 128); UHud.drawTexture(matrices, 0, 0, backgroundU, backgroundV, size, size, 128, 128);

View file

@ -28,9 +28,9 @@ public class UHud extends DrawableHelper {
private final MinecraftClient client = MinecraftClient.getInstance(); private final MinecraftClient client = MinecraftClient.getInstance();
private final List<Slot> slots = Util.make(new ArrayList<>(), slots -> { private final List<Slot> slots = Util.make(new ArrayList<>(), slots -> {
slots.add(new Slot(this, AbilitySlot.PRIMARY, 0, 0, 8, 49, 38, 24).background(0, 5).foreground(0, 59)); slots.add(new Slot(this, AbilitySlot.PRIMARY, 0, 0, 8, 49, 38, 42).background(0, 5).foreground(0, 59));
slots.add(new Slot(this, AbilitySlot.SECONDARY, 26, -5, 3, 22, 17, 18).background(80, 105)); slots.add(new Slot(this, AbilitySlot.SECONDARY, 26, -5, 3, 22, 17, 19).background(80, 105));
slots.add(new Slot(this, AbilitySlot.TERTIARY, 36, 19, 3, 22, 17, 18).background(80, 105)); slots.add(new Slot(this, AbilitySlot.TERTIARY, 36, 19, 3, 22, 17, 19).background(80, 105));
}); });
public void render(InGameHud hud, MatrixStack matrices, float tickDelta) { public void render(InGameHud hud, MatrixStack matrices, float tickDelta) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 754 B

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 998 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 621 B

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 802 B

After

Width:  |  Height:  |  Size: 768 B