Jump to content

Recommended Posts

Posted

I'm trying to load a background for my GUI, but the bottom of the image keeps getting cut off.

 

GuiInformationDisplay:

 

 

package terramagna.gui;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import net.minecraftforge.event.EventPriority;
import net.minecraftforge.event.ForgeSubscribe;
import org.lwjgl.opengl.GL11;
import terramagna.TerraMagna;
import terramagna.utils.PlayerStatsUtil;

public class GuiInformationDisplay extends Gui
{

private Minecraft mc;
private ResourceLocation texture = new ResourceLocation("terramagna", "textures/gui/hud_1.png");

public GuiInformationDisplay(Minecraft mc)
{

	super();

	this.mc = mc;

}

@ForgeSubscribe(priority = EventPriority.NORMAL)
public void onRenderexperienceBar(RenderGameOverlayEvent event)
{

	if(event.isCancelable() || event.type != ElementType.EXPERIENCE)
	{

		return;

	}

	String goldAmount = Integer.toString(PlayerStatsUtil.getExperience());

	FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;

	drawThing();

	fontRenderer.drawString("Terra Magna: " + TerraMagna.getVersion(), 2, 2, 0xFFFFFF);
	fontRenderer.drawString("Gold: " + goldAmount, 2, 12, 0xFFFF00);

}

public void drawThing()
{

	mc.renderEngine.bindTexture(texture);
	drawTexturedModalRect(-35, 0, 128, 32, 128, 32);

}

}

 

 

 

 

Here's the image I'm trying to load:

http://i.imgur.com/SmmJq7A.png

Kain

Posted

Now I miss Hydroflame lolz :P

 

Haha, he isn't the only one with some GUI tricks xD He at least can explain what they do though.... I just know how to implement them. Where are his tessellator tutorials exactly? Or an even better question... Where are good ones? ( That includes his ).

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

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.