本文整理汇总了Python中pyglet.window.Window.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Window.__init__方法的具体用法?Python Window.__init__怎么用?Python Window.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyglet.window.Window
的用法示例。
在下文中一共展示了Window.__init__方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyglet.window import Window [as 别名]
# 或者: from pyglet.window.Window import __init__ [as 别名]
def __init__(self, view_size=(10,10),scale=(10),*args, **kwargs):
Window.__init__(self, *args, **kwargs)
self.set_mouse_visible(True)
self.view_scale = scale#min(self.width/view_size[0],self.height/view_size[1])
self.view_size = view_size
self.undo = UndoManager(self)
self.width = self.view_scale*self.view_size[0]
self.height = self.view_scale*self.view_size[1]
self.setup()
示例2: __init__
# 需要导入模块: from pyglet.window import Window [as 别名]
# 或者: from pyglet.window.Window import __init__ [as 别名]
def __init__(self):
vs = True # limit FPS or something
try:
# Try and create a window with multisampling (antialiasing)
config = Config(sample_buffers=1, samples=4,
depth_size=16, double_buffer=True,)
GLWindow.__init__(self, self.sizeX, self.sizeY, vsync=vs,
resizable=False, config=config)
except pyglet.window.NoSuchConfigException:
# Fall back to no multisampling for old hardware
super(Melee, self).__init__(self.sizeX, self.sizeY, vsync=vs,
resizable=False)
# Initialize OpenGL
squirtle.setup_gl()
示例3: __init__
# 需要导入模块: from pyglet.window import Window [as 别名]
# 或者: from pyglet.window.Window import __init__ [as 别名]
def __init__(self):
self.icons = Icons()
#self.sounds = Sounds()
Window.__init__(self)
glEnable(GL_DEPTH_TEST)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
self.set_caption(AppTitle)
self.set_icon(self.icons.Icon16)
# self.btnStart = pyglet.input.Button('Jugar')
# self.btnConfig = pyglet.input.Button('Config')
# self.btnAbout = pyglet.input.Button('Acerca')
self.titlelabel = pyglet.text.Label(Title,
font_name='Tahoma',
font_size=32,
x = self.width // 2,
y = self.height // 2,
anchor_x='center',
anchor_y='center'
)
示例4: __init__
# 需要导入模块: from pyglet.window import Window [as 别名]
# 或者: from pyglet.window.Window import __init__ [as 别名]
def __init__(self,a_world):
# super(MainWnd,self).__init__()
Window.__init__(self)
# init GL options
glEnable(GL_CULL_FACE)
glFrontFace(GL_CCW)
glCullFace(GL_BACK)
glPolygonMode(GL_FRONT, GL_FILL)
glPolygonMode(GL_BACK, GL_LINE)
glEnable(GL_DEPTH_TEST)
glDepthFunc(GL_LEQUAL)
# create the world
self.the_world=a_world
# create the camera
self.the_camera=camera.Camera()
self.the_camera.x=400
self.the_camera.y=-350
self.the_camera.z=80
示例5: __init__
# 需要导入模块: from pyglet.window import Window [as 别名]
# 或者: from pyglet.window.Window import __init__ [as 别名]
def __init__(self, *args, **kw):
Window.__init__(self, *args, **kw)
self.init_window()
示例6: __init__
# 需要导入模块: from pyglet.window import Window [as 别名]
# 或者: from pyglet.window.Window import __init__ [as 别名]
def __init__(self, height, width):
Window.__init__(self, height, width)
self.clock_setted = False
self.complete = 0
self.center = Point(height/2, width/2)