Jump to content

[1.7.2] Drawing one image but not drawing another


RadioactiveStud

Recommended Posts

Hello, I am drawing image onto the main screen. For some reason, the image I am trying to draw is coming out completely transparent, but any other image I draw with the same exact method is working fine.

I might have exported it out of gimp wrong or something. Any ideas?

 

Other images working:

b0fc4ecb7045d657a341753047a68506.png

 

But not the one I want:

c44cf87eebbb929afa0b4e9e5897bcff.png

 

Here's my code:

 

private final GUIOverlay gui = new GUIOverlay();

@SideOnly(Side.CLIENT)
@SubscribeEvent
public void renderOverlay(RenderGameOverlayEvent.Post event){
if(event.isCancelable() || event.type != ElementType.EXPERIENCE) return;
if(EventArmorFullSet.size != 0)
	gui.drawArmor();
}

 

public class GUIOverlay {

public void drawArmor() {
ResourceLocation r = null;
switch(EventArmorFullSet.size) {
case 1:
	r = set("half");
	Minecraft mc = Minecraft.getMinecraft();
	ScaledResolution sr = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
	int x = sr.getScaledWidth() - 225;
	int y = sr.getScaledHeight() - 50;
	mc.getTextureManager().bindTexture(r);
	Util.drawTexturedModalRect(x, y, 0, 0, 9, 9);
	break;
	}
}

public ResourceLocation set(String size){
	return new ResourceLocation(Reference.PREFIX + "textures/gui/armorBar_half.png");
}
}

 

Lead DivineRPG Developer

Link to comment
Share on other sites

There is a post I had recently about orang color where GreyGhost posted some very helpfull material.  Search and read up on it.

 

Before doign anything elaborate, I would boundary your render code inside push/pop calls to make sure that you are not being gifted by some other gl calls.

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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