|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
如题,代码如下
- import cocos
- class HelloWorld(cocos.scene.Scene):
- def __init__(self):
- cocos.scene.Scene.__init__(self)
- label = cocos.text.Label('Hello 歌者', anchor_x='left', anchor_y='top')
- label.position = (0, 0)
- self.add(label)
- if __name__ == '__main__':
- cocos.director.director.init(width=640, height=480, caption='Threebody')
- bye = HelloWorld()
- cocos.director.director.run(cocos.scene.Scene(bye))
复制代码
上面的标题“threebody”如何隐藏,就是不显示,只显示窗口
本帖最后由 dolly_yos2 于 2023-2-27 18:48 编辑
从 cocos2d 的文档看,cocos.director.director.init 支持的参数是 pyglet.window.Window 的超集
pyglet.window.Window 有一个 style 参数,可以设置为 pyglet.window.Window.WINDOW_STYLE_BORDERLESS,可能能建议窗口管理器将窗口装饰为无边框模式
https://los-cocos.github.io/cocos-site/doc/api/cocos.director.html#initializing
https://los-cocos.github.io/cocos-site/doc/api/cocos.director.html#cocos.director.Director.init
https://pyglet.readthedocs.io/en/latest/modules/window.html?highlight=ScreenMode#pyglet.window.Window
https://pyglet.readthedocs.io/en/latest/modules/window.html?highlight=ScreenMode#pyglet.window.Window.WINDOW_STYLE_BORDERLESS
|
|