Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The layer size cannot match the window on MacBook #358

Open
MTurandot opened this issue Jun 26, 2023 · 3 comments
Open

The layer size cannot match the window on MacBook #358

MTurandot opened this issue Jun 26, 2023 · 3 comments

Comments

@MTurandot
Copy link

MTurandot commented Jun 26, 2023

I am a beginner and now trying a script list on my M1 MacBook Air as following:

import cocos


class MainLayer(cocos.layer.ColorLayer):
    def __init__(self):
        super().__init__(255, 128, 128, 128)

        label = cocos.text.Label('Hello World!', font_size=64, anchor_x="right", anchor_y="top")
        label.position = 800, 600
        self.add(label)


if __name__ == '__main__':
    cocos.director.director.init(resizable=True, width=800, height=600, caption='cocos_hello_world')
    cocos.director.director.run(cocos.scene.Scene(MainLayer()))


The result:
截屏2023-06-26 15 16 17

After that, I have also tried:

import cocos


class MainLayer(cocos.layer.ColorLayer):
    def __init__(self):
        super().__init__(255, 128, 128, 128)

        label = cocos.text.Label('Hello World!', font_size=64, anchor_x="right", anchor_y="top")
        label.position = 800, 600
        self.add(label)

        self.anchor_x = 0
        self.anchor_y = 0
        self.scale = 2


if __name__ == '__main__':
    cocos.director.director.init(resizable=True, width=800, height=600, caption='cocos_hello_world')
    cocos.director.director.run(cocos.scene.Scene(MainLayer()))

but it did not work, either.
Could someone tell me what the problem is and how to solve it? Thanks

My environment:

macOS Ventura 13.4
Python 3.10
cocos2d 0.6.9
pyglet 1.5.27

@shayneoneill
Copy link

Yeah I have the same problem :/

@shayneoneill
Copy link

shayneoneill commented Jul 6, 2023

Hmm. Seems like the solution is to use pyglet 2.x, but that seems incompatible with Cocos2d. Feels like a no-win scenario at this point. Unfortunate, Cocos is hands down the best game engine on python, but this doesnt seem like a solveable problem at least for my skillset. (Lots of OpenGL stuff in there that I have no idea how it works)

@LeoLee98
Copy link

Yeah I have the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants