Jump to content

[1.7.2] GuiScreen.drawRect not working with variables in arguments.


Recommended Posts

Posted

Here is my code: http://pastebin.com/yegwWq2C

 

As for what it is supposed to be doing, it's job is to take variables from my main logic file and display a red square at the given point. I have be using chat statements to test and confirm that my math is correct and that the GUI file was handling them properly. Everything is set up correctly and always points to a valid location on screen. It even works if I replace everything with constants, what am I doing wrong?

Posted

You are missing a semicolon at line 5 in your pastebin, but I do not think this is your problem. Yesterday I had the same problem. I tried to render my own progress bar with raw opengl, but it did not affect the gui at all. Then I tried to use drawRect instead of opengl, but still it did not work. Funnily drawTexturedModalRect worked.

 

BTW: I am extending GuiContainer and not GuiScreen, but it should be the same problem.

 

One tip: Have you tried to debug minecraft with your IDE? Watch the variables, which are given to drawRect.

try {

...

}catch(Throwable t) {

    MagicAppErrorSolver.solveProblem(t, this);

}

//Programmers will lose work

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.