Posted April 17, 20169 yr Hello all, I have just begun work with the gui class and I am dynamically populating the text to render to screen. I can get the text to word wrap properly within the width bounds of the extended GuiScreen class I have built.I am having trouble finding the right method to calculate the height of the sting after I have called drawSplitString() from the FontRenderer class. I would like to dynamically change the size of the background or clip the original string for placement on a subsequent screen if at all possible. Any suggestions? Thanks
April 17, 20169 yr Size of a character is 8. Now you need to figure out lines count. You may have to use same methods as vanilla does to determine amount of splits to string. Then you can calculate total height. Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
April 17, 20169 yr FontRenderer#FONT_HEIGHT gives you the height of the current font. http://i.imgur.com/NdrFdld.png[/img]
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.