Jump to content

Recommended Posts

Posted

How can I be more specific? I gave you link to tutorial that gives perfect example on how to use this event.

 

To be more informative I can add:

Tick != FPS

 

Ticks are 20/sec and are used to update game data, while lwjgl works alone just using that data. You can't draw stuff inside ticking methods (like you did there). You need to use RenderGameOverlayEvent and draw your stuff there. That event gives you access to overlay screen and width/height of it.

1.7.10 is no longer supported by forge, you are on your own.

Posted

Okay! I've got some things working but not completely! First off, I was wondering how I would scale the image so it always fits the full screen. Currently it's just set to the size of the image, and if the screen size is larger than the image, the image begins to repeat itself.

 

Here's my code for Event Handler: http://pastebin.com/FxWwCmvh

 

Here are my screenshots:

http://snag.gy/NESzb.jpg

http://snag.gy/pwiPC.jpg

 

ALSO! When I try to check if the armor (Helmet) is equipped (currently the commented out code), the game crashes.

 

Here's my crash report: http://pastebin.com/UDCu6pV3

 

Any help would be greatly appreciated! Thanks! :D

Posted

                        ScaledResolution Scaled = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
                        this.drawNonStandardTexturedRect(xPos, yPos, 0, 0, mc.displayWidth, mc.displayHeight, 420, 250);

You have a variable for a scaled resolution, yet you don't use it. Use this:

                        ScaledResolution Scaled = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
                        this.drawNonStandardTexturedRect(xPos, yPos, 0, 0, Scaled.getScaledWidth(), Scaled.getScaledHeight(), 420, 250);

 

//if (((EntityPlayer)mc.thePlayer).inventory.armorInventory[3].getItem() == halocraft.Main.SpartanHelmet){

Check if inventory.armorInventory[3] != null first

Posted

"ALSO! When I try to check if the armor (Helmet) is equipped (currently the commented out code), the game crashes."

 

- Solution is to first take given slot (slots are ItemStacks array) and check if itemStack != null. Only after that you can get item from non-null ItemStack.

 

Resizing will be simply HARD. If you'd accomplish it in any way, the results will be different on different clients and it might affect how your e.g map (bottom left) is displayed.

 

I suggest auto-aligning image to center and smooth-transition to dark on corners if size is exceeded.

In this case - have look at how vanilla renders viantage or how the close-to-worldd-border effect is being done (the red-shading on borders of screen).

1.7.10 is no longer supported by forge, you are on your own.

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.