Posted April 17, 20187 yr i want to draw a string in center when player is playing but it won't draw in correct location,it always draw in right,when i resize game to small,it draw in correct location Edited April 18, 20187 yr by yyk419476391 Question solved
April 17, 20187 yr Author 7 hours ago, diesieben07 said: Show your code. if (mc.theWorld != null) { String text = "Hello!"; int width = mc.fontRendererObj.getStringWidth(text); mc.fontRendererObj.drawStringWithShadow(text, mc.displayWidth/2-width/2, 0, 0xFFFFFF); } here's code
April 18, 20187 yr Author 25 minutes ago, diesieben07 said: You must use ScaledResolution::getScaledWidth. thank you very much
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.