Начинающий
			
			
				
					
				
			
		- Статус
 - Оффлайн
 
- Регистрация
 - 30 Апр 2025
 
- Сообщения
 - 3
 
- Реакции
 - 0
 
- Выберите загрузчик игры
 - ForgeOptiFine
 
Короче всем привет,я решил усовершенствовать код @bloodytraxaet теперь кнопки подсвечиваются плавно при наводке
SS-
(Извините,я новичек в этой теме)
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
				
			
SS-
	Пожалуйста, авторизуйтесь для просмотра ссылки.
(Извините,я новичек в этой теме)
			
				Java:
			
		
		
		private float animationProgress = 0.0f;
    public void renderButton(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
        Minecraft minecraft = Minecraft.getInstance();
        FontRenderer fontrenderer = minecraft.fontRenderer;
        minecraft.getTextureManager().bindTexture(WIDGETS_LOCATION);
        RenderSystem.color4f(1.0F, 1.0F, 1.0F, this.alpha);
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.enableDepthTest();
        // Update animation progress
        float targetProgress = this.isHovered ? 1.0f : 0.0f;
        animationProgress = MathHelper.lerp(0.2f, animationProgress, targetProgress);
        // Interpolate color
        int r = (int) MathHelper.lerp(animationProgress, 16, 40);
        int g = (int) MathHelper.lerp(animationProgress, 16, 40);
        int b = (int) MathHelper.lerp(animationProgress, 16, 40);
        DisplayUtils.drawRoundedRect(this.x-0.5f, this.y-0.9f, this.width+2 / 2, this.height+1.5f, 4.5f, ColorUtils.setAlpha(ColorUtils.getColor(0), 212)); //out
        DisplayUtils.drawShadow(this.x-0.5f, this.y-0.5f, this.width+2 / 2, this.height+2, 5, ColorUtils.setAlpha(ColorUtils.getColor(0), 100)); //out
        DisplayUtils.drawRoundedRect(this.x, this.y, this.width, this.height, 4, ColorUtils.rgb(r, g, b));
        this.renderBg(matrixStack, minecraft, mouseX, mouseY);
        int j = this.active ? 16777215 : 10526880;
        drawCenteredString(matrixStack, fontrenderer, this.getMessage(), this.x + this.width / 2, this.y + (this.height - 8) / 2, j | MathHelper.ceil(this.alpha * 255.0F) << 24);
    }