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

So i created a texture with 50% Transparency but when i load it into minecraft it rensers like a Solid.

What can i do?

Up is what it should look like. [added w/ Paint.NET]

Down what it renders. [using the code below]

uQNOycZ.png

	@ForgeSubscribe
public void TestRender(RenderGameOverlayEvent.Post event){
	//========Resolution========
	res = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
	int width = res.getScaledWidth();
	int height = res.getScaledHeight();
	//========Resolution========+

   	this.mc.renderEngine.func_110577_a(new ResourceLocation("/Num/Chintzy/" + "Preview" + ".png"));
    	drawTexturedModalRect(100, 100, 0, 0, 500, 500);
    	mc.func_110434_K().func_110577_a(Gui.field_110324_m);
    	
}

Before you call drawTextureModalRect, call glColor. Example for 50% transparency:

 

@ForgeSubscribe
public void TestRender(RenderGameOverlayEvent.Post event){
	//========Resolution========
	res = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
	int width = res.getScaledWidth();
	int height = res.getScaledHeight();
	//========Resolution========+

	this.mc.renderEngine.func_110577_a(new ResourceLocation("/Num/Chintzy/" + "Preview" + ".png"));
	[b]GL11.glColor4f(1, 1, 1, 0.5f);[/b]
	drawTexturedModalRect(100, 100, 0, 0, 500, 500);
	mc.func_110434_K().func_110577_a(Gui.field_110324_m);
}

I like to make mods, just like you. Here's one worth checking out

no. you have to enable blending

 

GL11.glEnable(GL11.GL_BLEND);

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

well even if you do call glColor it wont work unless blending is enabled, and bte its a bad practice to call glColor except when using a colorless texture that you want to programmatically change the color of. in his case the image seems/should be completelly baked in the image

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

  • Author

Nope.. still nothing..  :(

 

	@ForgeSubscribe
public void ArmorlvlTest(RenderGameOverlayEvent.Post event){

	//========Resolution========
	res = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
	int width = res.getScaledWidth();
	int height = res.getScaledHeight();
	//========Resolution========+
	this.mc.renderEngine.func_110577_a(new ResourceLocation("Num/Chintzy/Preview.png"));

        GL11.glEnable(GL11.GL_BLEND);
        GL11.glColor4f(1, 1, 1, 0.5f);
        drawTexturedModalRect(width-120, height-80, 75, 105, 110, 50);
    	mc.func_110434_K().func_110577_a(Gui.field_110324_m);
    	
}

You need the push/popMatrix...

 

So this:

        @ForgeSubscribe
public void ArmorlvlTest(RenderGameOverlayEvent.Post event){

	//========Resolution========
	res = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
	int width = res.getScaledWidth();
	int height = res.getScaledHeight();
	//========Resolution========+
	this.mc.renderEngine.func_110577_a(new ResourceLocation("Num/Chintzy/Preview.png"));

        GL11.glPushMatrix();

        GL11.glEnable(GL11.GL_BLEND);

        drawTexturedModalRect(width-120, height-80, 75, 105, 110, 50);
    	mc.func_110434_K().func_110577_a(Gui.field_110324_m);

        GL11.glPopMatrix();
    	
}

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Lol.... Try using the PRE render event. And I know what I am talking about with those two statements I think you will find. Without them, openGL does NOTHING. xD

 

But that about nearly covers what I do know about openGL... I can do translation, rotation and resizing. That is about it.

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

I could be way off here and just a shot in the dark, but you may need to add an alpha mask to the image.  Saving regular transparency ive noticed like with liquid blocks they wont render partially transparent without an alpha mask.

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.