Posted February 16, 201411 yr Hey guys, Got one last snag in my GUIWidgets mod. It's at a usable, releasable stage now, but this graphical bug is annoying me! Basically, whenever I resize the screen, my text gets distorted. But, not always. I'm in the process of switching to a slightly better way of rendering items which uses glScalef differently. Unfortunately, the old way of doing it (Read from the vanilla icons texture, scale it up 2.0F) made my text scale perfectly; but when I switched to my new way (Read from a custom png file, already scaled so no need to resize), the text distorts on scale up. Here's an image which shows what I mean. Health and EXP are on the new system, Hunger is on the old system: here's the code for Health. I'm currently popping GL before I get to health and then pushing again, so I KNOW nothing previous will be affecting it. Below that is the code from hunger where it's all inclusive. //render health bar if (config.healthText) { GL11.glPushMatrix(); GL11.glScalef(0.5F, 0.5F, 0.5F); font.drawStringWithShadow("Health: " + health + "/" + maxHealth, xPos + 22, yPos + 6, config.healthTextColour); GL11.glPopMatrix(); } GL11.glPushMatrix(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);; GL11.glDisable(GL11.GL_LIGHTING); GL11.glScalef(0.5F, 0.5F, 0.5F); mc.renderEngine.bindTexture(guiStatsBar); this.drawTexturedModalRect(xPos, yPos, 0, 128, sizeX, sizeY); this.drawTexturedModalRect(xPos + 2, yPos + 2, 0, 76, hungerAmount, 16); this.drawTexturedModalRect(xPos, yPos, 0, 20, sizeX, sizeY); this.mc.renderEngine.bindTexture(vanillaIcons); GL11.glScalef(2.0F, 2.0F, 2.0F); this.drawTexturedModalRect(Math.round(xPos / 2) + 1, Math.round(yPos / 2), 16, 36, 9, 9); if (config.hungerText) { GL11.glScalef(0.5F, 0.5F, 0.5F); font.drawStringWithShadow("Hunger: " + hunger + "/" + maxHunger, xPos + 22, yPos + 6, config.hungerTextColour); } GL11.glPopMatrix(); http://s13.postimg.org/z9mlly2av/siglogo.png[/img] My mods (Links coming soon) Cities | Roads | Remula | SilvaniaMod | MoreStats
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.