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

Ok, I have an overlay that slides in and out of the screen on a key press. While it's sliding, it creates some weird delay shadows behind it.

 

This is what the delayed shadow looks like:

BjPJmsE.png

 

Here's my render code:

package legions.gui;

import legions.ClientProxyL;
import legions.UtilL;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.util.ResourceLocation;

import org.lwjgl.opengl.GL11;

import com.sun.org.apache.xml.internal.security.utils.I18n;

public class GuiMenuL extends GuiScreen {
public static final ResourceLocation TEXTURE = UtilL.newResource("textures/gui/icons.png");

public void draw(ScaledResolution sr) {
	GL11.glPushMatrix();
	GL11.glTranslatef(0, ClientProxyL.guiY, 0);
	UtilL.MC.renderEngine.bindTexture(TEXTURE);
	this.drawTexturedModalRect(0, 0, 0, 0, 128, 65);
	int x = (int) UtilL.getScaledX(12, sr);
	UtilL.drawOutlinedString("Menu", x, (int) UtilL.getScaledY(10, sr), 0xFFFFFF, 0x000000);
	switch(ClientProxyL.currentMenu) {
	case (0): {
		UtilL.drawString("1-Summon troops", x, (int) UtilL.getScaledY(30, sr), 0x000000);
		UtilL.drawString("2-Order troops", x, (int) UtilL.getScaledY(48, sr), 0x000000);
		UtilL.drawString("3-", x, (int) UtilL.getScaledY(66, sr), 0x000000);
		UtilL.drawString("4-", x, (int) UtilL.getScaledY(84, sr), 0x000000);
		UtilL.drawString("5-", x, (int) UtilL.getScaledY(102, sr), 0x000000);
		break;
	}
	case (1): {
		UtilL.drawString("1-All troops", x, (int) UtilL.getScaledY(30, sr), 0x000000);
		UtilL.drawString("2-Group 1", x, (int) UtilL.getScaledY(48, sr), 0x000000);
		UtilL.drawString("3-Group 2", x, (int) UtilL.getScaledY(66, sr), 0x000000);
		UtilL.drawString("4-Group 3", x, (int) UtilL.getScaledY(84, sr), 0x000000);
		UtilL.drawString("5-Group 4", x, (int) UtilL.getScaledY(102, sr), 0x000000);
		break;
	}
	}
	GL11.glPopMatrix();
}
}

Kain

  • Author

Ok, now the menu is just black now. The only change's I've made was some of the text I think.

 

package legions.gui;

import legions.ClientProxyL;
import legions.UtilL;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.util.ResourceLocation;

import org.lwjgl.opengl.GL11;

public class GuiMenuL extends GuiScreen {
public static final ResourceLocation TEXTURE = UtilL.newResource("textures/gui/icons.png");

public void draw(ScaledResolution sr) {
	GL11.glPushMatrix();
	GL11.glTranslatef(0, ClientProxyL.guiY, 0);
	UtilL.MC.renderEngine.bindTexture(TEXTURE);
	this.drawTexturedModalRect(0, 0, 0, 0, 128, 65);
	int x = (int) UtilL.getScaledX(12, sr);
	UtilL.drawOutlinedString("Menu", x, (int) UtilL.getScaledY(10, sr), 0xFFFFFF, 0x000000);
	switch(ClientProxyL.currentMenu) {
	case (0): {
		UtilL.drawString("1-Summon troops", x, (int) UtilL.getScaledY(30, sr), 0x000000);
		UtilL.drawString("2-Order troops", x, (int) UtilL.getScaledY(48, sr), 0x000000);
		UtilL.drawString("3-", x, (int) UtilL.getScaledY(66, sr), 0x000000);
		UtilL.drawString("4-", x, (int) UtilL.getScaledY(84, sr), 0x000000);
		UtilL.drawString("5-", x, (int) UtilL.getScaledY(102, sr), 0x000000);
		break;
	}
	case (1): {
		UtilL.drawString("1-All troops", x, (int) UtilL.getScaledY(30, sr), 0x000000);
		UtilL.drawString("2-Group 1", x, (int) UtilL.getScaledY(48, sr), 0x000000);
		UtilL.drawString("3-Group 2", x, (int) UtilL.getScaledY(66, sr), 0x000000);
		UtilL.drawString("4-Group 3", x, (int) UtilL.getScaledY(84, sr), 0x000000);
		UtilL.drawString("5-Group 4", x, (int) UtilL.getScaledY(102, sr), 0x000000);
		break;
	}
	}
	GL11.glPopMatrix();
}
}

 

pYyK5MQ.png

Kain

  • Author

You didn't disable GL11's lighting and then re enable it

 

Nope

 

 

Resetting the color did the job for me:

GL11.glColor3f(1, 1, 1);

Kain

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.