Posted November 25, 201311 yr I've been scratching my head over this one for awhile now. I'm trying to render font in the bottom left corner of the screen, but I can't figure out why y position to use. It changes based on the resolution and I can't seem to find any clear pattern (I've taken several screenshots and compared the height of the text to the resolution in Photoshop). I know I need to use 0 for the x position, but I'm stuck on y. Is there any way to find what height a string will be? I know there is a method for width. Thanks for any help you can provide. http://i.imgur.com/nVI9Y.png[/img]
November 25, 201311 yr ScaledResolution has your answer: Minecraft minecraft = Minecraft.getMinecraft(); ScaledResolution sr = new ScaledResolution(minecraft.gameSettings, minecraft.displayWidth, minecraft.displayHeight); int y = sr.getScaledHeight(); //gives the screen height. Author of PneumaticCraft, MineChess, Minesweeper Mod and Sokoban Mod. Visit www.minemaarten.com to take a look at them.
November 25, 201311 yr Author I already know how to get the scaled height of the screen. The problem is that if I render the text at (0, scaledHeight), it will render off the screen and not show. I need to move the text up by how tall the text is, which is what I don't know how to find. http://i.imgur.com/nVI9Y.png[/img]
November 25, 201311 yr Author Ah thanks. I had a feeling I was missing something easy. I'll try that out when I get home. http://i.imgur.com/nVI9Y.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.