Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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)

  • Author
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)

 

  • Author
10 hours ago, diesieben07 said:

I mean why you are using drawTexturedModalRect from GuiUtils instead of AbstractGui.

because thats how you do it, i dont use .blit because i dont need it i prefer drawTexturedModalRect like usual

  • Author
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

  • Author
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

  • Author
1 hour ago, diesieben07 said:

Well what are they currently?

somewhere through the middle of my screen(but it changes depending of the size of minecraft)

x=350,y=150

my image(is a test but my image will have moreless the same size of the square):

https://imgur.com/a/wSRNA6D

Edited by ElTotisPro50

  • Author
2 hours ago, diesieben07 said:

So this will always be 350px from the left and 150px from the top of the screen. Is that where you want your image? Where do you want it?

yeah, ALWAYS NO MATTER WHAT SIZE IS MINECRAFT i want my image there

  • Author
8 hours ago, diesieben07 said:

Then your current code will accomplish just that.

x=200,y=90 (350 and 150 where too far from screen)

i dont have 3 images as overlays is just how they look(i painted them because i deleted the other screenshots)

but you can see clearly how the overlay moves

 

https://imgur.com/a/0fZ4pMs

  • Author
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?

  • Author
1 hour ago, ElTotisPro50 said:

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?

nope it didnt is almost the same thing

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...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.