Подведи собственные итоги года совместно с YOUGAME и забери ценные призы! Перейти

Вопрос Закругление в методе

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
17 Мар 2023
Сообщения
81
Реакции
1
сделал метод градиента что он переливаеться по горизонтали и цвет следует за цветом

Java:
Expand Collapse Copy
public static void hoz(float f123, float y1, float x2, float y2, float f8, int startColor, int endColor) {
        x2 += f123;
        y2 += y1;
        float f = (float) (startColor >> 24 & 255) / 255.0F;
        float f1 = (float) (startColor >> 16 & 255) / 255.0F;
        float f2 = (float) (startColor >> 8 & 255) / 255.0F;
        float f3 = (float) (startColor & 255) / 255.0F;
        float f4 = (float) (endColor >> 24 & 255) / 255.0F;
        float f5 = (float) (endColor >> 16 & 255) / 255.0F;
        float f6 = (float) (endColor >> 8 & 255) / 255.0F;
        float f7 = (float) (endColor & 255) / 255.0F;
        GlStateManager.disableTexture2D();
        GlStateManager.enableBlend();
        GlStateManager.disableAlpha();
        GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA,
                GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE,
                GlStateManager.DestFactor.ZERO);
        GlStateManager.shadeModel(7425);
        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder bufferbuilder = tessellator.getBuffer();
        bufferbuilder.begin(7, DefaultVertexFormats.POSITION_COLOR);
        bufferbuilder.pos(f123, y1, 0).color(f1, f2, f3, f).endVertex();
        bufferbuilder.pos(f123, y2, 0).color(f1, f2, f3, f).endVertex();
        bufferbuilder.pos(x2, y2, 0).color(f5, f6, f7, f4).endVertex();
        bufferbuilder.pos(x2, y1, 0).color(f5, f6, f7, f4).endVertex();
        tessellator.draw();
        GlStateManager.shadeModel(7424);
        GlStateManager.disableBlend();
        GlStateManager.enableAlpha();
        GlStateManager.enableTexture2D();
    }
он постояно квадратный чтобы я не делал я изменял другие методы смотрел изо чего они закругляются и как работают но так не понял
пример кода вот таймер индикатор
RenderUtility.hoz((float) timer.timerIndicatorDraggable.getX() - 0.25f, (float) timer.timerIndicatorDraggable.getY() - 0.55f, timer.animWidth * 74.0f + 0.5f, 9.0f,8,ColorUtility.getColor(0).getRGB(), ColorUtility.getColor(90).getRGB());
Fonts.mntssb16.drawCenteredString((int) Math.floor((var7 - var8) / var7 * 100.0f) + "% - timer", (double) (81.0f * timer.animWidth + 25.0f) + (double) timer.timerIndicatorDraggable.getX() - 0.25, (double) ((float) timer.timerIndicatorDraggable.getY() + 1.05f), Color.WHITE.getRGB());

только он квадратный нахуй и нечего ему не помогает
помогите сделать чтоб его можно было закруглять
 
сделал метод градиента что он переливаеться по горизонтали и цвет следует за цветом

Java:
Expand Collapse Copy
public static void hoz(float f123, float y1, float x2, float y2, float f8, int startColor, int endColor) {
        x2 += f123;
        y2 += y1;
        float f = (float) (startColor >> 24 & 255) / 255.0F;
        float f1 = (float) (startColor >> 16 & 255) / 255.0F;
        float f2 = (float) (startColor >> 8 & 255) / 255.0F;
        float f3 = (float) (startColor & 255) / 255.0F;
        float f4 = (float) (endColor >> 24 & 255) / 255.0F;
        float f5 = (float) (endColor >> 16 & 255) / 255.0F;
        float f6 = (float) (endColor >> 8 & 255) / 255.0F;
        float f7 = (float) (endColor & 255) / 255.0F;
        GlStateManager.disableTexture2D();
        GlStateManager.enableBlend();
        GlStateManager.disableAlpha();
        GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA,
                GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE,
                GlStateManager.DestFactor.ZERO);
        GlStateManager.shadeModel(7425);
        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder bufferbuilder = tessellator.getBuffer();
        bufferbuilder.begin(7, DefaultVertexFormats.POSITION_COLOR);
        bufferbuilder.pos(f123, y1, 0).color(f1, f2, f3, f).endVertex();
        bufferbuilder.pos(f123, y2, 0).color(f1, f2, f3, f).endVertex();
        bufferbuilder.pos(x2, y2, 0).color(f5, f6, f7, f4).endVertex();
        bufferbuilder.pos(x2, y1, 0).color(f5, f6, f7, f4).endVertex();
        tessellator.draw();
        GlStateManager.shadeModel(7424);
        GlStateManager.disableBlend();
        GlStateManager.enableAlpha();
        GlStateManager.enableTexture2D();
    }
он постояно квадратный чтобы я не делал я изменял другие методы смотрел изо чего они закругляются и как работают но так не понял
пример кода вот таймер индикатор
RenderUtility.hoz((float) timer.timerIndicatorDraggable.getX() - 0.25f, (float) timer.timerIndicatorDraggable.getY() - 0.55f, timer.animWidth * 74.0f + 0.5f, 9.0f,8,ColorUtility.getColor(0).getRGB(), ColorUtility.getColor(90).getRGB());
Fonts.mntssb16.drawCenteredString((int) Math.floor((var7 - var8) / var7 * 100.0f) + "% - timer", (double) (81.0f * timer.animWidth + 25.0f) + (double) timer.timerIndicatorDraggable.getX() - 0.25, (double) ((float) timer.timerIndicatorDraggable.getY() + 1.05f), Color.WHITE.getRGB());

только он квадратный нахуй и нечего ему не помогает
помогите сделать чтоб его можно было закруглять
У тебя в идеи написано range: 0, сделай 1-5 и будет тебе круг в кубической игре
Ну к примеру в 21-25 строке, надеюсь помог
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
сделал метод градиента что он переливаеться по горизонтали и цвет следует за цветом

Java:
Expand Collapse Copy
public static void hoz(float f123, float y1, float x2, float y2, float f8, int startColor, int endColor) {
        x2 += f123;
        y2 += y1;
        float f = (float) (startColor >> 24 & 255) / 255.0F;
        float f1 = (float) (startColor >> 16 & 255) / 255.0F;
        float f2 = (float) (startColor >> 8 & 255) / 255.0F;
        float f3 = (float) (startColor & 255) / 255.0F;
        float f4 = (float) (endColor >> 24 & 255) / 255.0F;
        float f5 = (float) (endColor >> 16 & 255) / 255.0F;
        float f6 = (float) (endColor >> 8 & 255) / 255.0F;
        float f7 = (float) (endColor & 255) / 255.0F;
        GlStateManager.disableTexture2D();
        GlStateManager.enableBlend();
        GlStateManager.disableAlpha();
        GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA,
                GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE,
                GlStateManager.DestFactor.ZERO);
        GlStateManager.shadeModel(7425);
        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder bufferbuilder = tessellator.getBuffer();
        bufferbuilder.begin(7, DefaultVertexFormats.POSITION_COLOR);
        bufferbuilder.pos(f123, y1, 0).color(f1, f2, f3, f).endVertex();
        bufferbuilder.pos(f123, y2, 0).color(f1, f2, f3, f).endVertex();
        bufferbuilder.pos(x2, y2, 0).color(f5, f6, f7, f4).endVertex();
        bufferbuilder.pos(x2, y1, 0).color(f5, f6, f7, f4).endVertex();
        tessellator.draw();
        GlStateManager.shadeModel(7424);
        GlStateManager.disableBlend();
        GlStateManager.enableAlpha();
        GlStateManager.enableTexture2D();
    }
он постояно квадратный чтобы я не делал я изменял другие методы смотрел изо чего они закругляются и как работают но так не понял
пример кода вот таймер индикатор
RenderUtility.hoz((float) timer.timerIndicatorDraggable.getX() - 0.25f, (float) timer.timerIndicatorDraggable.getY() - 0.55f, timer.animWidth * 74.0f + 0.5f, 9.0f,8,ColorUtility.getColor(0).getRGB(), ColorUtility.getColor(90).getRGB());
Fonts.mntssb16.drawCenteredString((int) Math.floor((var7 - var8) / var7 * 100.0f) + "% - timer", (double) (81.0f * timer.animWidth + 25.0f) + (double) timer.timerIndicatorDraggable.getX() - 0.25, (double) ((float) timer.timerIndicatorDraggable.getY() + 1.05f), Color.WHITE.getRGB());

только он квадратный нахуй и нечего ему не помогает
помогите сделать чтоб его можно было закруглять
ты совсем ебанутый? в обычном ректе сириуса примерно такая структура rect(x = корды x, y = y корды, x2 = width, y2 = height, сила скругления, цвет)
 
Назад
Сверху Снизу