[Интерфейс][1.7.10] Превязать к расширению окна.

svk

1,185
3
Сделал текстурку
Код:
        this.drawTexturedModalRect((int) (width/1.46), (int)(height/1.075), 0, 0, x, y);
Но прикол в том, что она отображается корректно, только под мой экран (1024х1048).
Если сделать окно по меньше, оно будет вылазить за рамки. Помогите, вот мой код
Код:
package com.svk.industrialGuns.Overlays;

import org.lwjgl.opengl.GL11;

import com.svk.industrialGuns.base.ModInfo;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.RenderGameOverlayEvent;

public class IconOverlay extends Gui
{
    public void renderOverlay(RenderGameOverlayEvent e)
    {
        ResourceLocation icon = new ResourceLocation(ModInfo.MODID, "textures/gui/gunsbar.png");
        
        Minecraft mc = Minecraft.getMinecraft();
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glDisable(GL11.GL_LIGHTING);
        
        int x = 256;
        int y = 256;
        
        ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft(), Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight);
        int width = sr.getScaledWidth();
        int height = sr.getScaledHeight();
        
        mc.renderEngine.bindTexture(icon);
        this.drawTexturedModalRect((int) (width/1.46), (int)(height/1.075), 0, 0, x, y);
    }
}
[merge_posts_bbcode]Добавлено: 20.02.2015 23:29:17[/merge_posts_bbcode]

+ Как достать игрока, если есть только  Minecraft mc = Minecraft.getMinecraft();
 
Назад
Сверху