GUI scaling off-center in 1.17 snapshot

Started by Kuraion on

Topic category: Troubleshooting, bugs, and solutions

Last seen on 11:46, 11. Dec 2021
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
GUI scaling off-center in 1.17 snapshot

Images added to GUIs scale weirdly on the 1.17 snapshot, it's like their anchor point is off-center

Unless this is some kind of new feature I'm not smart enough to figure out, this is a bug since it works perfectly fine on 1.16.5

 

This is what my GUI looks like when the game window is really small, it's almost correct

GUI screenshot

But this is what it looks like when I make the window full-sized
GUI screenshot

Last seen on 11:46, 11. Dec 2021
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If I had to guess, I'd…
Fri, 11/05/2021 - 17:48

If I had to guess, I'd assume that it's because while 1.16.5 used a variable for the middle of the screen and added the offset, while 1.17 snapshot uses absolute values:

1.16.5:

this.blit(ms, this.guiLeft + 162, this.guiTop + 58, 0, 0, 8, 4, 8, 4);

1.17.1:

this.blit(ms, 281, 78, 0, 0, 8, 4, 8, 4);

I can confirm that these absolute values are also used on newly created GUIs, not just on the one converted from 1.16.5. 

Last seen on 11:46, 11. Dec 2021
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Done!
Fri, 11/05/2021 - 19:23

Done!