Posted February 15, 20178 yr Hello, it is me again. I am creating a GUI the first time and try step by step to create it on my own. But at this point I am stucked again. My buttons seem very messy(posted screenshot). How cann I fix this? And can I cange the texture of a button like I do in my code? Button GUI(in onACtionPerformed I change the texture) Edited February 16, 20178 yr by Pingubro
February 15, 20178 yr Gui#drawTexturedModalRect expects your image to be 256x256 pixels. Use GuiScreen#drawModalRectWithCustomSizedTexture with the last 2 arguments being the texture width and height. Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
February 15, 20178 yr Author Thank you very much, now I have the problem that the buttons start to glimmer yellow if i hover them. But this is also shifted to the button on their left. How can I highlight them in the default white? And also how can I position it correctly?
February 15, 20178 yr 2 minutes ago, Pingubro said: And also how can I position it correctly? Right now you are changing the texture position on the image, not the position of the actual button. I don't know what you mean by "glimmer yellow", can you maybe describe your issues a bit better? Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
February 15, 20178 yr Author Thank you, but I am asking for the way how to position the yellow highlighting of my button. And also how to color it white. See screen for proper description.
February 15, 20178 yr So you mean your glimmer is in the wrong place? else if (this.hovered) { j = 16777120; } To change the color, you have to change that value. It is now 16777120, which is hex value 0xFFFFBE, which is slightly yellow. Use 16777215, or 0xFFFFFF for white. A bit weird is that the only place that is used for is the rendering of text, which may also be why the position is wrong, as you always pass in an empty String as the button text. You either have to fiddle around with the positions or make your own method for rendering a colored overlay on top of your button. Edited February 15, 20178 yr by larsgerrits Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
February 15, 20178 yr Author 15 minutes ago, larsgerrits said: So you mean your glimmer is in the wrong place? Yes that is what I mean.
February 16, 20178 yr Author So als the title says and the comments my Buttons dont highlight properly. Can somebody maybe tell me how it is done in Minecraft e.g. slot highlighting? Edited February 16, 20178 yr by Pingubro
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.