Posted October 1, 201411 yr Hi, im using the drawBackground method inside GuiContainer and when i draw my texture its too small (i want it bigger than 256) when i scale the texture using GL11.glScalef(x, y, z); it makes it bigger but when i change the size of the screen it moves. So how do i get a scaled texture to stay in a ration depending on what the screen size is? I currently have this: public class GuiKaren extends GuiContainer { public GuiKaren() { super(new ContainerEmpty()); } @Override protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(new ResourceLocation(SlayerAPI.PREFIX + "textures/gui/people/karen.png")); int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; GL11.glPushMatrix(); float scale = 1.0F; GL11.glScalef(scale, scale, scale); this.drawTexturedModalRect(k - 100, l, 0, 0, 220, 220); int guit = ClientTickHandler.guit; this.mc.getTextureManager().bindTexture(new ResourceLocation(SlayerAPI.PREFIX + "textures/gui/background.png")); if(guit > 5) { this.drawTexturedModalRect(k - 130, l - 120, 0, 0, 232, 100); } else if(guit < 5) { this.drawTexturedModalRect(k - 130, l - 120, 0, 102, 232, 100); } else { this.drawTexturedModalRect(k - 130, l - 120, 0, 0, 232, 100); } GL11.glPopMatrix(); } } Former developer for DivineRPG, Pixelmon and now the maker of Essence of the Gods
October 1, 201411 yr Something like this: GL11.glTranslatef(k - 100, l, 0); GL11.glScalef(scale, scale, scale); this.drawTexturedModalRect(0, 0, 0, 0, 220, 220);
October 1, 201411 yr Author <3 Former developer for DivineRPG, Pixelmon and now the maker of Essence of the Gods
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.