Jump to content

[1.10.2] [SOLVED] Gui That Doesn't Pause Game


Jimmeh

Recommended Posts

Do you have any idea which import that is? I can't seem to find any that returns an int value (that's what drawRect() is looking for) :/ The only one I see that returns an int is Color.HSBtoRGB(float hue, float saturation, float brightness)

The # means you need an instance of that type. So do Color color = new Color(R, G, B).getRGB();

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Do you have any idea which import that is? I can't seem to find any that returns an int value (that's what drawRect() is looking for) :/ The only one I see that returns an int is Color.HSBtoRGB(float hue, float saturation, float brightness)

The # means you need an instance of that type. So do Color color = new Color(R, G, B).getRGB();

 

Oooooooh. I thought you guys just did that instead of using a decimal xD

Well, good news is something displayed up top. Bad news is, I have no idea where any of that is coming from O_O

https://gyazo.com/57afd183d694cde09cd5c1a2df39ce5a

Link to comment
Share on other sites

Do you have any idea which import that is? I can't seem to find any that returns an int value (that's what drawRect() is looking for) :/ The only one I see that returns an int is Color.HSBtoRGB(float hue, float saturation, float brightness)

The # means you need an instance of that type. So do Color color = new Color(R, G, B).getRGB();

 

Oooooooh. I thought you guys just did that instead of using a decimal xD

Well, good news is something displayed up top. Bad news is, I have no idea where any of that is coming from O_O

https://gyazo.com/57afd183d694cde09cd5c1a2df39ce5a

I believe that means that textures are bound weirdly. Instead of

TextureManager textureManager = ClientProxy.MINECRAFT.getTextureManager();
textureManager.bindTexture(new ResourceLocation(Test.MODID + ":textures/gui/energybar.png"));

Just do

this.mc.getTextureManager().bindTexture(// Create ResourceLocation in a variable in the class instead of creating it every time the code is ran.//)

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Following up on this, I think either TextureManager or something in GlStateManager needs to be "reset" after being used each time, that way colors don't appear in other objects they're not suppose to. I tried GlStateManager.resetColor(), but that doesn't work

Link to comment
Share on other sites

Following up on this, I think either TextureManager or something in GlStateManager needs to be "reset" after being used each time, that way colors don't appear in other objects they're not suppose to. I tried GlStateManager.resetColor(), but that doesn't work

I would use the pop and push methods.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Following up on this, I think either TextureManager or something in GlStateManager needs to be "reset" after being used each time, that way colors don't appear in other objects they're not suppose to. I tried GlStateManager.resetColor(), but that doesn't work

I would use the pop and push methods.

 

public void draw(){
        textureManager.bindTexture(get);
        GlStateManager.pushMatrix();

        //---- outline ----
        GlStateManager.enableAlpha();
        drawTexturedModalRect(0, 0, 0, 0, xSize, ySize);

        //---- inner ----
        drawRect(3, 4, getRightCoord(), ySize - 3, GuiHandler.ENERGYBAR);

        GlStateManager.popMatrix();
        GlStateManager.resetColor();
    }

 

Unfortunately that's not it either :/ That's what I have so far

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.