Jump to content

[1.7.10] GuiOverlay


BusyBeever

Recommended Posts

Hey everyone,

first of all I know a lot of people will be complaining that 1.7 is ancient, but I cant update until mods I depent on do.

 

I got an GUIOverlay that is supposed to render text to the screen. It works fince in 1.10 (with some minor adjustments to the newer version) but in 1.7 there is no text showing, and I have no idea why.

The code is getting called, I see my sysout on the console

 

@SubscribeEvent
public void onRenderExperienceBar(RenderGameOverlayEvent event) {

	if(holder==null) holder = QuestHolder.get();
	if(event.isCancelable() && (event.type==ElementType.ALL)) {
		mc.getTextureManager().bindTexture(texture);
		ScaledResolution sr = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);

		int i=0;
		int height = 30; 
		mc.fontRenderer.drawStringWithShadow("Test", sr.getScaledWidth()/2, sr.getScaledHeight()/2, 0xFFFFFF);
		for (Quest quest : holder.getQuests()) {
			System.out.println(holder.getQuests().size());
			if(!quest.isFollowed()) {
				mc.fontRenderer.drawString(quest.getName(), 100, height, WHITE);

				for(Condition condition:quest.getConditions()) {
					i+=1;

					mc.fontRenderer.drawString(condition.getDescription(), 30, height+10*i, condition.isFinished()? GREEN: RED);
				}
				i=0;

				height+=50;

			}
		}
	}
}

 

 

Link to comment
Share on other sites

Yeah, 1.7.10 is quite outdated, and projects for it should be discontinued or updated.

However, I do still have this 1.7.10 project which I will be updating sometime to 1.10.2.

 

Here, I've already checked for blocks implementing a specific interface, and then call this method, which then creates a HUD of it's name, akin to basic WAILA.

https://github.com/Matryoshika/Saligia/blob/master/src/main/java/Matryoshika/mods/saligia/rendering/GUI/HUDRitual.java

 

That's all I can do for ya'.

 

 

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Link to comment
Share on other sites

Integer.parseInt("FFFFFF", 16)

Replace that with 0xFFFFFF .. What u are doing is slow and dirty

 

I know. All that, was my first ever project for modding minecraft, with zero previous experience with Java, bar doing some C# (~80% Java) 2 years prior.

It's a baaaaad project, I know, I won't deny that, but that is why it's on hold, so that I can learn everything I should.

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Link to comment
Share on other sites

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.