Jump to content

weird fonts


Recommended Posts

i'm trying to draw a health new health bar on the in game in my tick handler.

but the font is acting really weird.

never had a problem with this before but since i updated to 1.5 it stated happening.

what happens is for 1 sec when the game loads it gives the normal font.

but afterwards the font gets the texture of the image i rendered underneath it.


this is my code:

GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture("/mods/legendz/textures/gui/hud.png"));
		gig.drawTexturedModalRect((width/2)-91, (height)-39, 0, 96, 82, 9);
		gig.drawTexturedModalRect((width/2)-89, height-37, 0, 105, 78, 5);

		gig.drawCenteredString(fontrenderer, player.getHealth()+"/"+player.getMaxHealth(), width/2-45, height-39, 0xFFFFFF);

Link to comment
Share on other sites

The method is func_98187_b. But I don't know if it'll work. What I did was before you bind new texture:

int prevtext = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D);

And before you render text

GL11.glBindTexture(GL11.GL_TEXTURE_2D, prevtext);

Worked for me

Link to comment
Share on other sites

@diesieben07: Not if you sync them afterwards. I agree, using OGL sometimes may cause some bugs, but not if you know what you do. Besides, their new system broke everything in terms of rendering, and there's no guaranty it'll stay the way it is. IMO, in some way, OGL can be even better and more reliable (again, if you know what you're doing and sync everything afterwards).

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.

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.