Jump to content

momar

Members
  • Posts

    3
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

momar's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. So, I now just took the code from ZyinHUD (https://github.com/Zyin055/zyinhud/blob/master/src/main/java/com/zyin/zyinhud/ZyinHUDRenderer.java), and it finally works like a charm! IBakedModel iBakedModel = mc.getRenderItem().getItemModelMesher().getItemModel(new ItemStack(item)); TextureAtlasSprite textureAtlasSprite = mc.getTextureMapBlocks().getAtlasSprite(iBakedModel.getTexture().getIconName()); mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); worldrenderer.startDrawingQuads(); worldrenderer.addVertexWithUV((double)(x), (double)(y + height), 0.0, (double)textureAtlasSprite.getMinU(), (double)textureAtlasSprite.getMaxV()); worldrenderer.addVertexWithUV((double)(x + width), (double)(y + height), 0.0, (double)textureAtlasSprite.getMaxU(), (double)textureAtlasSprite.getMaxV()); worldrenderer.addVertexWithUV((double)(x + width), (double)(y), 0.0, (double)textureAtlasSprite.getMaxU(), (double)textureAtlasSprite.getMinV()); worldrenderer.addVertexWithUV((double)(x), (double)(y), 0.0, (double)textureAtlasSprite.getMinU(), (double)textureAtlasSprite.getMinV()); tessellator.draw(); The second problem solved itself: I stupid human did use posX instead of posY... Yeah, my first Forge mod is finally one small step furter Thanks for your help momar
  2. The texture is 16x16, but if I use 16 in the method call, I get the top left pixel of the icon... Or, in the case of records, it doesn't do anything at all because that pixel is transparent... Seems like the UV map size is 256x256 for every texture... This is what I tried with glScaled: GL11.glScaled(16 / 256, 16 / 256, 16 / 256); It does not show the icon or anything after the statement at all, and instead makes event the GUI overlay (Escape menu, death screen, chat input line, ...) completely invisible, even if I run glScaled again with 256/16...
  3. Hey guys, I'm working at my first ever forge mod at the moment (http://spng.pw/t/5496), and I want to draw a notification box onto the screen, just like this little achievement box in the top right corner. What I did so far: Drawing something onto the screen (the achievement box itself) with a class extending net.minecraft.client.gui.Gui with SubscribeEvent to a RenderGameOverlayEvent. What I want to do now: Draw the icon of a music disc on top of the box. What I have tried: Approach 1: this.mc.renderEngine.bindTexture(new ResourceLocation("textures/items/record_cat.png")); this.drawTexturedModalRect(posX + 8, posY + 8, 0, 0, 256, 256); This draws a 256x256 pixels huge music disc onto my screen. Not really what I want... Approach 2: new RenderItem(this.mc.getTextureManager(), new ModelManager(theProblem)).renderItemIntoGUI(new ItemStack(Item.getByNameOrId("sign"), 1), posX + 8, posY + ; The problem: where can I get the TextureMap for the ModelManager constructor from? I only found out that I can get it from ModelManager, and to get one of those I need a TextureMap?! What I want to do after that: Draw some text onto the box. this.mc.fontRendererObj.drawStringWithShadow("Text, where are you?!", posX + 32, posX + 8, 0xffffffff); Does not do anything at all, unfortunately... Am I doing everything completely wrong or is there a light at the end of my code? Thanks in advance momar P.S.: My whole class:
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.