Начинающий
- Статус
- Оффлайн
- Регистрация
- 2 Июн 2024
- Сообщения
- 203
- Реакции
- 3
- Выберите загрузчик игры
- Vanilla
code:
private void renderWatermark(PoseStack stack) {
int back = StyleFactory.backMenu2.getRGB();
int posX = 5, posY = 5;
Drawer.shadow(stack, posX, posY, 44, 12, 8, back);
Drawer.rect(stack, posX, posY, 44, 12, 2, back);
Drawer.shadow(stack, posX, posY, 1, 12, 8, StyleFactory.cheatColor.getRGB());
Drawer.rect(stack, posX, posY, 1, 12, 1, StyleFactory.cheatColor.getRGB());
textUtils.glitchText(stack, 8.5f, 8.3f, "FATALIY", Drawer.menuText[12]);
}
text util:
private long startTime;
public void setStartTime(long startTime) {
this.startTime = startTime;
}
public void glitchText(PoseStack stack, float x, float y, String text, FontRenderer font) {
Color textColor = new Color(0xC4C4C2);
long currentTime = System.currentTimeMillis();
int animationSpeed = 280000;
float progress = (float) ((currentTime - startTime) % animationSpeed) / animationSpeed;
random.setSeed((long) (progress * 1000));
float alpha = 0.5f + random.nextFloat() * 0.5f;
int glitchCount = 2 + random.nextInt(4);
for (int i = 0; i < glitchCount; i++) {
float glitchOffsetX = (random.nextFloat() - 0.5f) * 1.4f;
float glitchOffsetY = (random.nextFloat() - 0.5f) * 1.4f;
float colorProgress = (float) i / glitchCount;
float r = (float) StyleFactory.cheatColor.getRed() / 255 * (1 - colorProgress) + 0.4f * colorProgress;
float g = (float) StyleFactory.cheatColor.getGreen() / 255;
float b = (float) StyleFactory.cheatColor.getBlue() /255;
float glitchAlpha = alpha * (0.7f - i * 0.1f);
Color layerColor = new Color(r, g, b, glitchAlpha);
font.drawString(stack, text,
x + glitchOffsetX,
y + glitchOffsetY,
layerColor.getRGB());
}
if (random.nextFloat() > 0.7f) {
for (int i = 0; i < 2; i++) {
float flashAlpha = 0.8f + random.nextFloat() * 0.2f;
Color flashColor = i == 0 ?
new Color((float) StyleFactory.cheatColor.getRed() / 255, (float) StyleFactory.cheatColor.getGreen() / 255, (float) StyleFactory.cheatColor.getBlue() / 255,flashAlpha) : new Color(0.5f, 0.5f, 1.0f, flashAlpha);
font.drawString(stack, text,
x + (random.nextFloat() - 0.5f) * 0.8f,
y + (random.nextFloat() - 0.5f) * 0.8f,
flashColor.getRGB());
}
}
font.drawString(stack, text, x, y, textColor.getRGB());
}
в Hud onEnable:
onEnable:
TextUtils textUtils;
@Override
public void onEnable() {
textUtils = new TextUtils();
textUtils.setStartTime(System.currentTimeMillis());
super.onEnable();
}
там анимка если че


