当前位置: 首页>>代码示例>>Python>>正文


Python Window.set_location方法代码示例

本文整理汇总了Python中pyglet.window.Window.set_location方法的典型用法代码示例。如果您正苦于以下问题:Python Window.set_location方法的具体用法?Python Window.set_location怎么用?Python Window.set_location使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyglet.window.Window的用法示例。


在下文中一共展示了Window.set_location方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from pyglet.window import Window [as 别名]
# 或者: from pyglet.window.Window import set_location [as 别名]
def main():
    # Create the main window
    window = Window(800, 600, visible=False,
                   caption="FF:Tactics.py", style='dialog')
    # Create the default camera and have it always updating
    camera = Camera((-600, -300, 1400, 600), (400, 300), 300, speed=PEPPY)
    clock.schedule(camera.update)

    # Load the first scene
    world = World(window, camera)
    world.transition(MainMenuScene)

    # centre the window on whichever screen it is currently on
    window.set_location(window.screen.width/2 - window.width/2,
                        window.screen.height/2 - window.height/2)
    # clear and flip the window
    # otherwise we see junk in the buffer before the first frame
    window.clear()
    window.flip()

    # make the window visible at last
    window.set_visible(True)

    # finally, run the application
    pyglet.app.run()
开发者ID:johnmendel,项目名称:python-tactics,代码行数:27,代码来源:tactics.py

示例2: Window

# 需要导入模块: from pyglet.window import Window [as 别名]
# 或者: from pyglet.window.Window import set_location [as 别名]
from pyglet.clock import set_fps_limit
from pyglet.clock import schedule_interval
from pyglet.window import Window
from client.gui import Background
from client.gui import Button
from client.gui import QuitButton
from client.gui import TextWidget
from client.gui import UILabel
from client.gui import MyRectangle
from client.manager import GameManager
from client.view_objects import Player
from game.resources import Resources

game_window = Window(Resources.window_width, Resources.window_height)
game_window.set_caption("Push")
game_window.set_location(Resources.center_x, Resources.center_y)
fps = ClockDisplay()

manager = GameManager()
manager.set_window(game_window)

# Object Batches per state #
title_batch = Resources.batches["title"]
setup_batch = Resources.batches["setup"]
host_batch = Resources.batches["host"]
join_batch = Resources.batches["join"]
game_batch = Resources.batches["game"]
end_batch = Resources.batches["end"]
# End of Batches

my_bg = Background(name="my_bg", img=Resources.sprites["title_bg"])
开发者ID:nmcalabroso,项目名称:Push,代码行数:33,代码来源:client_push.py


注:本文中的pyglet.window.Window.set_location方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。