Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.