Jump to content

[1.10.2] [GuiScreen] Binding textures after drawString


faraddox

Recommended Posts

Why after drawing string with fontRendererObj it doesn't bind my texture, leaving unicode textrue in textureManager? Example:

this.fontRendererObj.drawString(level, guiX + 52, guiY + 12, 0xdddd00, true);
        this.mc.getTextureManager().bindTexture(texture);
        //---------------draw xp line 186px
        String xp = sg.getXP() + "/" + sg.getXPForNextLevel();
        int  perc = (sg.getXP() * 100) / sg.getXPForNextLevel();
        this.drawTexturedModalRect(guiX + 52, guiY + 24, 0, 24, 186 , 5);
        this.drawTexturedModalRect(guiX + 52, guiY + 24, 0, 29, 186 * perc / 100, 5);

If i don't bind this.mc.getTextureManager().bindTexture(texture); again, unicode texture will be used do drawTexturedModalRect

Mod,  that adds skill system (WIP, 1.10.2)

https://github.com/faraddox/NotEnoughSkills

Link to comment
Share on other sites

To render text on a screen, it has to bind the unicode texture to actually draw different letters and numbers from. It doesn't rebind the previous texture, so you have to do it after you are drawing text.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

To render text on a screen, it has to bind the unicode texture to actually draw different letters and numbers from. It doesn't rebind the previous texture, so you have to do it after you are drawing text.

Yes, i understand this after testing. I'm interesting why forge doesn't implement something better yet, cause i spend all night to test and find where is the problem :)

Mod,  that adds skill system (WIP, 1.10.2)

https://github.com/faraddox/NotEnoughSkills

Link to comment
Share on other sites

Forge doesn't change things that don't have to be changed.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

Because that's how Minecraft core works. Minecraft Forge already made an astounding job by providing essentials and more for mod development.

 

I'd rather say, why nobody created a Forge Codex/in-depth Documentation (that covers all aspects starting from adding stuff like blocks, items, etc. ending on complex stuff like client-server sync of custom entities/stuff, complex client rendering, GUI, etc.), yet? That will be much helpful, for everybody.

Blockbuster – simple machinimas and cinematics for Minecraft
Link to comment
Share on other sites

If you want, you can make a pull request to the Forge Documentation GitHub, and if it gets accepted, it will put on http://mcforge.readthedocs.io/, which already has some nice documentation.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

 

I'll be glad to, but I'm by no means a master or expert. I once wrote a tutorial about Capability System on PMC, but as you can see it more like "if you want this, do that, because that." :D

Blockbuster – simple machinimas and cinematics for Minecraft
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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