Jump to content

(1.16.5 MCP) draw overlay exactly where i put it


ElTotisPro50

Recommended Posts

when i use GuiUtils.drawTexturedModalRect, in x and y it draws in the correct position, but if i put minecraft in fullscreen the overlay moves and the same with fullscreen windowed, how can i make that the overlay's position doesnt change AT ALL if the screen is bigger or in fullscreen or small?

GuiUtils.drawTexturedModalRect(X,Y,blah,blah,blah,blah,blah)

Link to comment
Share on other sites

19 hours ago, diesieben07 said:

Show more of your code.

Why are you using GuiUtils instead of AbstractGui?

what do you mean with why im using GuiUtils? AbstractGui is for "mc.getTextureManager().bindTexture(AbstractGui.GUI_ICONS_LOCATION);" to make that the overlay doesnt bug(as you once told me) 

mc.getTextureManager().bindTexture(textureLocation);
gui.drawTexturedModalRect(X, Y, imageOffsetX, imageOffsetY, imageSizeX, imageSizeY,zLevel);
//"gui" is from GuiUtils
mc.getTextureManager().bindTexture(AbstractGui.GUI_ICONS_LOCATION);

//i dont know if i have to add or multiply something for example X + screen.topleft (is just an example)

 

Link to comment
Share on other sites

On 3/5/2022 at 5:25 AM, diesieben07 said:

That is not an argument... The code does the exact same thing.

Again: Show more of your code.

private static final GuiUtils gui = new GuiUtils();

@SubscribeEvent
public static void test(RenderGameOverlayEvent.Post event)
{
	if(event.getType() == RenderGameOverlayEvent.ElementType.ALL && !player.isSpectator()) 
	{
		mc.getTextureManager().bindTexture(MYTEXTURE);
                gui.drawTexturedModalRect(x, y, imageOffsetX, imageOffsetY, imageSizeX, imageSizeY,zLevel);
                mc.getTextureManager().bindTexture(AbstractGui.GUI_ICONS_LOCATION);
	}
}

it works but if i put minecraft in full screen the image change the position because the size of minecraft, the same happens if i put the game in full screen windowed or small

Link to comment
Share on other sites

59 minutes ago, diesieben07 said:

Why are you creating an instance of this class, it only contains static members. You are once again demonstrating your lack of basic Java knowledge.

Where do these values come from?

 

 

1- if something works dont move it hahaha, even if is not the best way to do it

2-from GuiUtils, the offsets are 0,0 because i want to draw the full 256x256 image, imagesizes are 256, i think zlevel puts the overlay far ahead or far behind depending of what integer you put(it doesnt matter)

 

so in x,y i want to add something that makes that the image position doesnt change depending of the size of minecraft

Link to comment
Share on other sites

59 minutes ago, diesieben07 said:

Please post actual screenshots of the smaller window sizes. Painting rectangles on the fullscreen picture doesn't really explain anything.

i just noticed that changing the size of the gui scale MOVES MY OVERLAY TOO DUDE WTF, it only keeps the image if i put it at the most left

would .blit help me to NOT MOVE THE OVERLAY?

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.