python-minecraft-clone icon indicating copy to clipboard operation
python-minecraft-clone copied to clipboard

Fix the problem: MacBook Screen has only 1/4 Problem

Open CrispyFlowe opened this issue 3 years ago • 3 comments

If you have problem when you using Mac: if the size was only 1/4, like this

Screen Shot 2022-03-06 at 10 00 06 PM

Python Minecraft Clone(MCPY) All platform Version https://github.com/CrispyFlowe/PythonMinecraftClone-Compatible-with-all-platforms-Version

You can try to change like this:

def on_resize(self, width, height)

            def on_resize(self, width, height):

	    print(f"Resize {width} * {height}")

                # before: gl.glViewport(0, 0, width, height)
	    gl.glViewport(0, 0, width * 2, height * 2) # multiply width & height by 2

	    self.camera.width = width
	    self.camera.height = height

It will be normal:

DISPLAY

  • CrispyFlowe

If you still have problem, you can contact me at

  • Youtube - 1: https://www.youtube.com/channel/UCzD7B_hlD90RUaCyHZzBmWg
  • Youtube - 2: https://m.youtube.com/channel/UCMJBARUQArhtbNp7v13n1RQ
  • Github: https://github.com/CrispyFlowe
  • Gmail: (1) [email protected] | (2) [email protected]

if MacBook have this problem, I suggest

#import platform

                def on_resize(self, width, height):
	        printf("Resize %d * %d", width, height)

                    if (platform.system() == "Darwin"):
	    	    width = width * 2
		    height = height * 2

	        self.camera.width = width
	        self.camera.height = height

CrispyFlowe avatar Mar 09 '22 03:03 CrispyFlowe

Thanks but I think it'd be better to fix this upstream in Pyglet than to use a hack ;)

obiwac avatar Mar 10 '22 06:03 obiwac

Maybe related: Issue @obiwac

drakeerv avatar Mar 17 '22 17:03 drakeerv

Probably yeah. That's an issue for Pyglet to fix though; I'll write a fix next time I'm in front of a Mac I can test this on ;)

obiwac avatar Mar 17 '22 21:03 obiwac