Подпишитесь на наш Telegram-канал, чтобы всегда быть в курсе важных обновлений! Перейти

Вопрос Сделать фон для itemesp

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
17 Мар 2023
Сообщения
81
Реакции
1
ss;
1706713795429.png

нужно сделать фон тоесть идет шрифт а за ним серый фон помогите сделать как на скрине с этим кодом
могу пройти в дискорд если нужно будет база сириуса 1.12.2
Java:
Expand Collapse Copy
    @EventTarget
    public void onDisplay(EventRender2D eventRender2D) {
        for (Entity entity : ItemESP.mc.world.loadedEntityList) {
            if (!(entity instanceof EntityItem) || !RenderUtility.isInViewFrustum(entity)) continue;
            double x = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)mc.getRenderPartialTicks();
            double y = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)mc.getRenderPartialTicks();
            double z = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)mc.getRenderPartialTicks();
            double width = (double)entity.width / 1.5;
            double height = entity.height + 0.2f;
            AxisAlignedBB aabb = new AxisAlignedBB(x - width, y, z - width, x + width, y + height, z + width);
            Vec3d[] vectors = new Vec3d[]{new Vec3d(aabb.minX, aabb.minY, aabb.minZ), new Vec3d(aabb.minX, aabb.maxY, aabb.minZ), new Vec3d(aabb.maxX, aabb.minY, aabb.minZ), new Vec3d(aabb.maxX, aabb.maxY, aabb.minZ), new Vec3d(aabb.minX, aabb.minY, aabb.maxZ), new Vec3d(aabb.minX, aabb.maxY, aabb.maxZ), new Vec3d(aabb.maxX, aabb.minY, aabb.maxZ), new Vec3d(aabb.maxX, aabb.maxY, aabb.maxZ)};
            ItemESP.mc.entityRenderer.setupCameraTransform(mc.getRenderPartialTicks(), 0);
            ScaledResolution sr = eventRender2D.getResolution();
            Vector4f position = null;
            for (Vec3d vector : vectors) {
                vector = RenderUtility.project2D(2, vector.x - ItemESP.mc.getRenderManager().renderPosX, vector.y - ItemESP.mc.getRenderManager().renderPosY, vector.z - ItemESP.mc.getRenderManager().renderPosZ);
                if (vector == null || !(vector.z > 0.0) || !(vector.z < 1.0)) continue;
                if (position == null) {
                    position = new Vector4f((float)vector.x, (float)vector.y, (float)vector.z, 0.0f);
                }
                position.x = (float)Math.min(vector.x, (double)position.x);
                position.y = (float)Math.min(vector.y, (double)position.y);
                position.z = (float)Math.max(vector.x, (double)position.z);
                position.w = (float)Math.max(vector.y, (double)position.w);
            }
            if (position != null) {
                ItemESP.mc.entityRenderer.setupOverlayRendering(2);
                double posX = position.x;
                double posY = position.y;
                double endPosX = position.z;
                int build = -1;
                String tag = ((EntityItem)entity).getItem().getDisplayName().toLowerCase() + (((EntityItem)entity).getItem().stackSize < 1 ? "" : " x" + ((EntityItem)entity).getItem().stackSize);

                Fonts.mntsb13.drawStringWithOutline(tag, (float)(posX + (endPosX - posX) / 2.0 - (double)(Fonts.nunito12.getStringWidth(tag) / 2)), (float)(posY - 10.0), build);
            }
            GlStateManager.enableBlend();
            ItemESP.mc.entityRenderer.setupOverlayRendering();
        }
    }
}
 
ss;Посмотреть вложение 269629
нужно сделать фон тоесть идет шрифт а за ним серый фон помогите сделать как на скрине с этим кодом
могу пройти в дискорд если нужно будет база сириуса 1.12.2
Java:
Expand Collapse Copy
    @EventTarget
    public void onDisplay(EventRender2D eventRender2D) {
        for (Entity entity : ItemESP.mc.world.loadedEntityList) {
            if (!(entity instanceof EntityItem) || !RenderUtility.isInViewFrustum(entity)) continue;
            double x = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)mc.getRenderPartialTicks();
            double y = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)mc.getRenderPartialTicks();
            double z = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)mc.getRenderPartialTicks();
            double width = (double)entity.width / 1.5;
            double height = entity.height + 0.2f;
            AxisAlignedBB aabb = new AxisAlignedBB(x - width, y, z - width, x + width, y + height, z + width);
            Vec3d[] vectors = new Vec3d[]{new Vec3d(aabb.minX, aabb.minY, aabb.minZ), new Vec3d(aabb.minX, aabb.maxY, aabb.minZ), new Vec3d(aabb.maxX, aabb.minY, aabb.minZ), new Vec3d(aabb.maxX, aabb.maxY, aabb.minZ), new Vec3d(aabb.minX, aabb.minY, aabb.maxZ), new Vec3d(aabb.minX, aabb.maxY, aabb.maxZ), new Vec3d(aabb.maxX, aabb.minY, aabb.maxZ), new Vec3d(aabb.maxX, aabb.maxY, aabb.maxZ)};
            ItemESP.mc.entityRenderer.setupCameraTransform(mc.getRenderPartialTicks(), 0);
            ScaledResolution sr = eventRender2D.getResolution();
            Vector4f position = null;
            for (Vec3d vector : vectors) {
                vector = RenderUtility.project2D(2, vector.x - ItemESP.mc.getRenderManager().renderPosX, vector.y - ItemESP.mc.getRenderManager().renderPosY, vector.z - ItemESP.mc.getRenderManager().renderPosZ);
                if (vector == null || !(vector.z > 0.0) || !(vector.z < 1.0)) continue;
                if (position == null) {
                    position = new Vector4f((float)vector.x, (float)vector.y, (float)vector.z, 0.0f);
                }
                position.x = (float)Math.min(vector.x, (double)position.x);
                position.y = (float)Math.min(vector.y, (double)position.y);
                position.z = (float)Math.max(vector.x, (double)position.z);
                position.w = (float)Math.max(vector.y, (double)position.w);
            }
            if (position != null) {
                ItemESP.mc.entityRenderer.setupOverlayRendering(2);
                double posX = position.x;
                double posY = position.y;
                double endPosX = position.z;
                int build = -1;
                String tag = ((EntityItem)entity).getItem().getDisplayName().toLowerCase() + (((EntityItem)entity).getItem().stackSize < 1 ? "" : " x" + ((EntityItem)entity).getItem().stackSize);

                Fonts.mntsb13.drawStringWithOutline(tag, (float)(posX + (endPosX - posX) / 2.0 - (double)(Fonts.nunito12.getStringWidth(tag) / 2)), (float)(posY - 10.0), build);
            }
            GlStateManager.enableBlend();
            ItemESP.mc.entityRenderer.setupOverlayRendering();
        }
    }
}
Бро хватит уже 3 раз ту же тему пересоздавать с одинаковым текстом, просто отрендери рект в той же позиции где у тебя текст, если ты и этого не осилишь то тебе лучше не лезть в создания софта на Майн
 
Бро хватит уже 3 раз ту же тему пересоздавать с одинаковым текстом, просто отрендери рект в той же позиции где у тебя текст, если ты и этого не осилишь то тебе лучше не лезть в создания софта на Майн
Я и спрашиваю как сделать чтобы человек скинул код как сделать
 
Я и спрашиваю как сделать чтобы человек скинул код как сделать
Ну так ты же банально можешь посмотреть как это в других визуалах сделано и понять как отрисовать бекграунд, а не ждать пока тебе код на блюдечке подадут
 
Назад
Сверху Снизу