Визуальная часть WaterMark | exp 3.1 ready

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
16 Окт 2024
Сообщения
11
Реакции
0
Выберите загрузчик игры
  1. Прочие моды
Сделал минималистичную вотермарку под експу, моя первая работа так что в будущем будет лучше
Скриншот 11-10-2025 213302.jpg

Java:
Expand Collapse Copy
package im.expensive.ui.display.impl;

import com.mojang.blaze3d.matrix.MatrixStack;
import im.expensive.events.EventDisplay;
import im.expensive.ui.display.ElementRenderer;
import im.expensive.utils.render.ColorUtils;
import im.expensive.utils.render.DisplayUtils;
import im.expensive.utils.render.font.Fonts;
import net.minecraft.util.ResourceLocation;

public class WatermarkRenderer implements ElementRenderer {

    private static final ResourceLocation LOGO = new ResourceLocation("expensive/images/hud/logo.png");
    private static final float WIDTH = 140f;
    private static final float HEIGHT = 18f;
    private static final float PADDING = 6f;
    private static final float CORNER_RADIUS = 5f;
    private long startTime = System.currentTimeMillis();

    @Override
    public void render(EventDisplay event) {
        MatrixStack matrix = event.getMatrixStack();
        float x = PADDING, y = PADDING;

        renderBackground(x, y);
        renderLogo(x, y);
        renderClientText(x, y);
        renderFps(x, y);
    }

    private void renderBackground(float x, float y) {
        DisplayUtils.drawRoundedRect(x, y, WIDTH, HEIGHT, CORNER_RADIUS,
                ColorUtils.rgba(0, 0, 0, 184));
    }

    private void renderLogo(float x, float y) {
        float logoSize = 14f;
        float logoX = x + 4f;
        float logoY = y + (HEIGHT - logoSize) / 2;

        DisplayUtils.drawImage(LOGO, logoX, logoY, logoSize, logoSize, ColorUtils.rgb(255, 255, 255));
    }

    private void renderClientText(float x, float y) {
        String text = "PastaClient";
        float textWidth = Fonts.sfui.getWidth(text, 9);
        float textX = x + 22f;
        float textY = y + (HEIGHT - 10) / 2 + 1f;

        int color = getRainbowColor();
        Fonts.sfui.drawText(new MatrixStack(), text, textX, textY, color, 9);
    }

    private void renderFps(float x, float y) {
        int fps = net.minecraft.client.Minecraft.getInstance().debugFPS;
        String fpsText = fps + " fps";
        float fpsWidth = Fonts.sfui.getWidth(fpsText, 7);
        float fpsX = x + WIDTH - fpsWidth - 10f;
        float fpsY = y + (HEIGHT - 8) / 2 + 1f;

        Fonts.sfui.drawText(new MatrixStack(), fpsText, fpsX, fpsY,
                ColorUtils.rgb(255, 255, 255), 7);
    }

    private int getRainbowColor() {
        long time = System.currentTimeMillis() - startTime;
        float hue = (time % 5000) / 5000f;
        return java.awt.Color.HSBtoRGB(hue, 0.8f, 1f);
    }
}
 
Сделал минималистичную вотермарку под експу, моя первая работа так что в будущем будет лучше
Посмотреть вложение 317435
Java:
Expand Collapse Copy
package im.expensive.ui.display.impl;

import com.mojang.blaze3d.matrix.MatrixStack;
import im.expensive.events.EventDisplay;
import im.expensive.ui.display.ElementRenderer;
import im.expensive.utils.render.ColorUtils;
import im.expensive.utils.render.DisplayUtils;
import im.expensive.utils.render.font.Fonts;
import net.minecraft.util.ResourceLocation;

public class WatermarkRenderer implements ElementRenderer {

    private static final ResourceLocation LOGO = new ResourceLocation("expensive/images/hud/logo.png");
    private static final float WIDTH = 140f;
    private static final float HEIGHT = 18f;
    private static final float PADDING = 6f;
    private static final float CORNER_RADIUS = 5f;
    private long startTime = System.currentTimeMillis();

    @Override
    public void render(EventDisplay event) {
        MatrixStack matrix = event.getMatrixStack();
        float x = PADDING, y = PADDING;

        renderBackground(x, y);
        renderLogo(x, y);
        renderClientText(x, y);
        renderFps(x, y);
    }

    private void renderBackground(float x, float y) {
        DisplayUtils.drawRoundedRect(x, y, WIDTH, HEIGHT, CORNER_RADIUS,
                ColorUtils.rgba(0, 0, 0, 184));
    }

    private void renderLogo(float x, float y) {
        float logoSize = 14f;
        float logoX = x + 4f;
        float logoY = y + (HEIGHT - logoSize) / 2;

        DisplayUtils.drawImage(LOGO, logoX, logoY, logoSize, logoSize, ColorUtils.rgb(255, 255, 255));
    }

    private void renderClientText(float x, float y) {
        String text = "PastaClient";
        float textWidth = Fonts.sfui.getWidth(text, 9);
        float textX = x + 22f;
        float textY = y + (HEIGHT - 10) / 2 + 1f;

        int color = getRainbowColor();
        Fonts.sfui.drawText(new MatrixStack(), text, textX, textY, color, 9);
    }

    private void renderFps(float x, float y) {
        int fps = net.minecraft.client.Minecraft.getInstance().debugFPS;
        String fpsText = fps + " fps";
        float fpsWidth = Fonts.sfui.getWidth(fpsText, 7);
        float fpsX = x + WIDTH - fpsWidth - 10f;
        float fpsY = y + (HEIGHT - 8) / 2 + 1f;

        Fonts.sfui.drawText(new MatrixStack(), fpsText, fpsX, fpsY,
                ColorUtils.rgb(255, 255, 255), 7);
    }

    private int getRainbowColor() {
        long time = System.currentTimeMillis() - startTime;
        float hue = (time % 5000) / 5000f;
        return java.awt.Color.HSBtoRGB(hue, 0.8f, 1f);
    }
}
гамно
 
Сделал минималистичную вотермарку под експу, моя первая работа так что в будущем будет лучше
Посмотреть вложение 317435
Java:
Expand Collapse Copy
package im.expensive.ui.display.impl;

import com.mojang.blaze3d.matrix.MatrixStack;
import im.expensive.events.EventDisplay;
import im.expensive.ui.display.ElementRenderer;
import im.expensive.utils.render.ColorUtils;
import im.expensive.utils.render.DisplayUtils;
import im.expensive.utils.render.font.Fonts;
import net.minecraft.util.ResourceLocation;

public class WatermarkRenderer implements ElementRenderer {

    private static final ResourceLocation LOGO = new ResourceLocation("expensive/images/hud/logo.png");
    private static final float WIDTH = 140f;
    private static final float HEIGHT = 18f;
    private static final float PADDING = 6f;
    private static final float CORNER_RADIUS = 5f;
    private long startTime = System.currentTimeMillis();

    @Override
    public void render(EventDisplay event) {
        MatrixStack matrix = event.getMatrixStack();
        float x = PADDING, y = PADDING;

        renderBackground(x, y);
        renderLogo(x, y);
        renderClientText(x, y);
        renderFps(x, y);
    }

    private void renderBackground(float x, float y) {
        DisplayUtils.drawRoundedRect(x, y, WIDTH, HEIGHT, CORNER_RADIUS,
                ColorUtils.rgba(0, 0, 0, 184));
    }

    private void renderLogo(float x, float y) {
        float logoSize = 14f;
        float logoX = x + 4f;
        float logoY = y + (HEIGHT - logoSize) / 2;

        DisplayUtils.drawImage(LOGO, logoX, logoY, logoSize, logoSize, ColorUtils.rgb(255, 255, 255));
    }

    private void renderClientText(float x, float y) {
        String text = "PastaClient";
        float textWidth = Fonts.sfui.getWidth(text, 9);
        float textX = x + 22f;
        float textY = y + (HEIGHT - 10) / 2 + 1f;

        int color = getRainbowColor();
        Fonts.sfui.drawText(new MatrixStack(), text, textX, textY, color, 9);
    }

    private void renderFps(float x, float y) {
        int fps = net.minecraft.client.Minecraft.getInstance().debugFPS;
        String fpsText = fps + " fps";
        float fpsWidth = Fonts.sfui.getWidth(fpsText, 7);
        float fpsX = x + WIDTH - fpsWidth - 10f;
        float fpsY = y + (HEIGHT - 8) / 2 + 1f;

        Fonts.sfui.drawText(new MatrixStack(), fpsText, fpsX, fpsY,
                ColorUtils.rgb(255, 255, 255), 7);
    }

    private int getRainbowColor() {
        long time = System.currentTimeMillis() - startTime;
        float hue = (time % 5000) / 5000f;
        return java.awt.Color.HSBtoRGB(hue, 0.8f, 1f);
    }
}
Прикольно канешна, тебе бы надо научится делать иконки или хотя-бы брать для того чтобы ватермарка не казалась пустой, ну и можно было впринципе накинуть на неё какую-нибудь текстуру тогда бы было вообще класс и да, замени вместо sfui используй лучше Monsterat Bold и сделай чуть текст по меньше немного и еще можно тень небольшую сделать, если захожешь могу тебе дать код, твой только переделанный, а так для начинающих пастеров если самому писать то пойдет
 
Сделал минималистичную вотермарку под експу, моя первая работа так что в будущем будет лучше
Посмотреть вложение 317435
Java:
Expand Collapse Copy
package im.expensive.ui.display.impl;

import com.mojang.blaze3d.matrix.MatrixStack;
import im.expensive.events.EventDisplay;
import im.expensive.ui.display.ElementRenderer;
import im.expensive.utils.render.ColorUtils;
import im.expensive.utils.render.DisplayUtils;
import im.expensive.utils.render.font.Fonts;
import net.minecraft.util.ResourceLocation;

public class WatermarkRenderer implements ElementRenderer {

    private static final ResourceLocation LOGO = new ResourceLocation("expensive/images/hud/logo.png");
    private static final float WIDTH = 140f;
    private static final float HEIGHT = 18f;
    private static final float PADDING = 6f;
    private static final float CORNER_RADIUS = 5f;
    private long startTime = System.currentTimeMillis();

    @Override
    public void render(EventDisplay event) {
        MatrixStack matrix = event.getMatrixStack();
        float x = PADDING, y = PADDING;

        renderBackground(x, y);
        renderLogo(x, y);
        renderClientText(x, y);
        renderFps(x, y);
    }

    private void renderBackground(float x, float y) {
        DisplayUtils.drawRoundedRect(x, y, WIDTH, HEIGHT, CORNER_RADIUS,
                ColorUtils.rgba(0, 0, 0, 184));
    }

    private void renderLogo(float x, float y) {
        float logoSize = 14f;
        float logoX = x + 4f;
        float logoY = y + (HEIGHT - logoSize) / 2;

        DisplayUtils.drawImage(LOGO, logoX, logoY, logoSize, logoSize, ColorUtils.rgb(255, 255, 255));
    }

    private void renderClientText(float x, float y) {
        String text = "PastaClient";
        float textWidth = Fonts.sfui.getWidth(text, 9);
        float textX = x + 22f;
        float textY = y + (HEIGHT - 10) / 2 + 1f;

        int color = getRainbowColor();
        Fonts.sfui.drawText(new MatrixStack(), text, textX, textY, color, 9);
    }

    private void renderFps(float x, float y) {
        int fps = net.minecraft.client.Minecraft.getInstance().debugFPS;
        String fpsText = fps + " fps";
        float fpsWidth = Fonts.sfui.getWidth(fpsText, 7);
        float fpsX = x + WIDTH - fpsWidth - 10f;
        float fpsY = y + (HEIGHT - 8) / 2 + 1f;

        Fonts.sfui.drawText(new MatrixStack(), fpsText, fpsX, fpsY,
                ColorUtils.rgb(255, 255, 255), 7);
    }

    private int getRainbowColor() {
        long time = System.currentTimeMillis() - startTime;
        float hue = (time % 5000) / 5000f;
        return java.awt.Color.HSBtoRGB(hue, 0.8f, 1f);
    }
}
это очень плохо...
 
Сделал минималистичную вотермарку под експу, моя первая работа так что в будущем будет лучше
Посмотреть вложение 317435
Java:
Expand Collapse Copy
package im.expensive.ui.display.impl;

import com.mojang.blaze3d.matrix.MatrixStack;
import im.expensive.events.EventDisplay;
import im.expensive.ui.display.ElementRenderer;
import im.expensive.utils.render.ColorUtils;
import im.expensive.utils.render.DisplayUtils;
import im.expensive.utils.render.font.Fonts;
import net.minecraft.util.ResourceLocation;

public class WatermarkRenderer implements ElementRenderer {

    private static final ResourceLocation LOGO = new ResourceLocation("expensive/images/hud/logo.png");
    private static final float WIDTH = 140f;
    private static final float HEIGHT = 18f;
    private static final float PADDING = 6f;
    private static final float CORNER_RADIUS = 5f;
    private long startTime = System.currentTimeMillis();

    @Override
    public void render(EventDisplay event) {
        MatrixStack matrix = event.getMatrixStack();
        float x = PADDING, y = PADDING;

        renderBackground(x, y);
        renderLogo(x, y);
        renderClientText(x, y);
        renderFps(x, y);
    }

    private void renderBackground(float x, float y) {
        DisplayUtils.drawRoundedRect(x, y, WIDTH, HEIGHT, CORNER_RADIUS,
                ColorUtils.rgba(0, 0, 0, 184));
    }

    private void renderLogo(float x, float y) {
        float logoSize = 14f;
        float logoX = x + 4f;
        float logoY = y + (HEIGHT - logoSize) / 2;

        DisplayUtils.drawImage(LOGO, logoX, logoY, logoSize, logoSize, ColorUtils.rgb(255, 255, 255));
    }

    private void renderClientText(float x, float y) {
        String text = "PastaClient";
        float textWidth = Fonts.sfui.getWidth(text, 9);
        float textX = x + 22f;
        float textY = y + (HEIGHT - 10) / 2 + 1f;

        int color = getRainbowColor();
        Fonts.sfui.drawText(new MatrixStack(), text, textX, textY, color, 9);
    }

    private void renderFps(float x, float y) {
        int fps = net.minecraft.client.Minecraft.getInstance().debugFPS;
        String fpsText = fps + " fps";
        float fpsWidth = Fonts.sfui.getWidth(fpsText, 7);
        float fpsX = x + WIDTH - fpsWidth - 10f;
        float fpsY = y + (HEIGHT - 8) / 2 + 1f;

        Fonts.sfui.drawText(new MatrixStack(), fpsText, fpsX, fpsY,
                ColorUtils.rgb(255, 255, 255), 7);
    }

    private int getRainbowColor() {
        long time = System.currentTimeMillis() - startTime;
        float hue = (time % 5000) / 5000f;
        return java.awt.Color.HSBtoRGB(hue, 0.8f, 1f);
    }
}
а, не заметил что первая работа, тогда не плохо
 
зачем такое выкладывать , на отъебись сделано
Я просто на 3.1 чит делал потом понял что это не база а хуйня и перешёл на другую, а вотермарку решил на югейм залить
 
Назад
Сверху Снизу