Jump to content

Recommended Posts

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

Posted

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

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.