Posted July 6, 20178 yr The title says it. This is what I have so far. https://hastebin.com/uqameqebiw.scala All that does is render a purple square in the top left corner of my screen, like this. This is a screenshot of my file path for my image Please let me know what I am doing wrong, thanks!
July 6, 20178 yr Your assets folder should be in resources, not in java. Also it appears that your texture is called "photo.png", but you are looking for "hackerNotify.png". Asset path names should also be entirely lowercase.
July 6, 20178 yr Author @Alpvax Thank you for the suggestions! I have updated my project. And this is my new code. https://hastebin.com/palikucuho.scala However, I still have the same issue.
July 6, 20178 yr wr.pos(0, 0, 0).tex(90, 90).endVertex(); wr.pos(0, 256, 0).tex(90, 90).endVertex(); wr.pos(256, 0, 0).tex(90, 90).endVertex(); wr.pos(256, 256, 0).tex(90, 90).endVertex(); Vertices must be specified either CW or CCW, not in a "flipped N" order as you currently are doing(that's why your texture looks like a triangle). UVs range from 0 to 1, and different vertices should have different UVs. ResourceLocation textureLocation = new ResourceLocation("hackerdt", "assets/hackernotify.png"); assets/ gets resolved automatically, you do not need to specify it in your path. You must have your resources(textures/sounds/jsons/etc) in assets/modid/ folder. GlStateManager.pushMatrix(); GlStateManager.popMatrix(); ? RenderGameOverlayEvent has different ElementTypes you need to check, otherwise you will be drawing your image multiple times a frame for each thing the event fires for. A priority of an event is NORMAL by default, you do not need to explicitly specify it.
July 6, 20178 yr Author 23 minutes ago, V0idWa1k3r said: wr.pos(0, 0, 0).tex(90, 90).endVertex(); wr.pos(0, 256, 0).tex(90, 90).endVertex(); wr.pos(256, 0, 0).tex(90, 90).endVertex(); wr.pos(256, 256, 0).tex(90, 90).endVertex(); Vertices must be specified either CW or CCW, not in a "flipped N" order as you currently are doing(that's why your texture looks like a triangle). UVs range from 0 to 1, and different vertices should have different UVs. ResourceLocation textureLocation = new ResourceLocation("hackerdt", "assets/hackernotify.png"); assets/ gets resolved automatically, you do not need to specify it in your path. You must have your resources(textures/sounds/jsons/etc) in assets/modid/ folder. GlStateManager.pushMatrix(); GlStateManager.popMatrix(); ? RenderGameOverlayEvent has different ElementTypes you need to check, otherwise you will be drawing your image multiple times a frame for each thing the event fires for. A priority of an event is NORMAL by default, you do not need to explicitly specify it. Can I have some example code for a 256 x 256 square? I find it easier to learn by looking at code and then going through it and understanding it, plus it gives me something I can reference in the future
July 6, 20178 yr 2 minutes ago, BillehBawb said: Can I have some example code for a 256 x 256 square? Look at the methods in the class you are extending - Gui. The image dimenions are irrelevant as you specify everything yourself. Edited July 6, 20178 yr by V0idWa1k3r
July 6, 20178 yr Try using Gui.drawTexturedModalRect(...). Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
July 6, 20178 yr Author 1 hour ago, Kokkie said: Try using Gui.drawTexturedModalRect(...). 1 hour ago, V0idWa1k3r said: Look at the methods in the class you are extending - Gui. The image dimenions are irrelevant as you specify everything yourself. Thanks both of you, after some experimenting I got it to show up. I just have a few more small questions... first off, is there a simple way to just display text? I want to display text over my image and it changed depending on arguments and the situation.
July 6, 20178 yr Gui.drawString(...) Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
July 6, 20178 yr Author 1 minute ago, Kokkie said: Gui.drawString(...) Gui.drawString does not appear for me
July 6, 20178 yr That's because it isn't static, try Minecraft.getMinecraft().ingameGUI. Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
July 6, 20178 yr 40 minutes ago, Kokkie said: That's because it isn't static, try Minecraft.getMinecraft().ingameGUI. Ooorr... just use this.drawString, since you have access to it because you extend the Gui class. 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/
July 8, 20178 yr On 6-7-2017 at 10:51 PM, larsgerrits said: Ooorr... just use this.drawString, since you have access to it because you extend the Gui class. I forgot he extended that... Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
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.