Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
global angles
if done_yet():
pyglet.app.exit()
window.clear()
for i, ent in enumerate(ents1):
ent.angle+=rates1[i]
polygon_domain1.update()
render_domain.draw()
fps_display.draw()
pyglet.clock.schedule(lambda _: None)
pyglet.app.run()
window_size = window.get_size()
if __name__ == '__main__':
init()
display = TableclothDisplay(window, '../images/seamless-montage.png', '.')
pyglet.clock.set_fps_limit(120)
pyglet.clock.schedule(scroll)
pyglet.clock.schedule_interval(new_photo, NEW_PHOTO_INTERVAL)
pyglet.clock.schedule_interval(check_queue, 1)
new_photo()
pyglet.app.run()
if done_yet():
pyglet.app.exit()
window.clear()
for i, ent in enumerate(ents):
angles[i]+=rates[i]
ent.rotate_and_render(angles[i])
draw()
fps_display.draw()
#pyglet.clock.set_fps_limit(60)
pyglet.clock.schedule(lambda _: None)
pyglet.app.run()
import pyglet
class HelloWorldWindow(pyglet.window.Window):
def __init__(self):
super(HelloWorldWindow, self).__init__()
self.label = pyglet.text.Label('Hello, world!', x=10, y=10)
def on_draw(self):
self.clear()
self.label.draw()
if __name__ == '__main__':
window = HelloWorldWindow()
pyglet.app.run()
center_x = 119
center_y = 155
x = center_x + (hat_x * 50)
y = center_y + (hat_y * 50)
stick_sprite.position = x, y
@window.event
def on_draw():
window.clear()
batch.draw()
if __name__ == "__main__":
pyglet.clock.schedule_interval(lambda dt: None, 1/30.0)
pyglet.app.run()
def play_media(self):
try:
self.myplayer = pyglet.media.Player()
self.myplayer.push_handlers(on_eos=self.what_next)
self.source = pyglet.media.load(self.parent.currentTrack)
self.myplayer.queue(self.source)
self.myplayer.play()
pyglet.app.run()
except:
pass
objects.append(spaceship)
def draw_all_objects():
window.clear()
for obj in objects:
obj.draw()
init_spaceship()
window.push_handlers(
on_draw=draw_all_objects
)
pyglet.app.run()
#!/usr/bin/env python3
import glooey
import pyglet
window = pyglet.window.Window()
gui = glooey.Gui(window)
label = glooey.Label('Hello world!')
gui.add(label)
pyglet.app.run()
def on_draw():
"""Obsluha události - překreslení obsahu okna."""
glClear(GL_COLOR_BUFFER_BIT)
glLoadIdentity()
glBegin(GL_TRIANGLES)
glColor3f(1, 0, 0)
glVertex2f(window.width/2, 0)
glColor3f(0, 1, 0)
glVertex2f(0, window.height)
glColor3f(0, 0, 1)
glVertex2f(window.width, window.height)
glEnd()
# spuštění smyčky pro zpracování událostí
pyglet.app.run()
for index in range(0, self.F_ACTORS):
agents[index].x = int(self.world.getState('Actor' + str(index), 'x').domain()[0]) * 32
agents[index].y = int(self.world.getState('Actor' + str(index), 'y').domain()[0]) * 32
for index in range(0, self.E_ACTORS):
enemies[index].x = int(self.world.getState('Enemy' + str(index), 'x').domain()[0]) * 32
enemies[index].y = int(self.world.getState('Enemy' + str(index), 'y').domain()[0]) * 32
for index in range(0, self.D_ACTORS):
distractors[index].x = int(self.world.getState('Distractor' + str(index), 'x').domain()[0]) * 32
distractors[index].y = int(self.world.getState('Distractor' + str(index), 'y').domain()[0]) * 32
pyglet.clock.schedule_interval(update, 0.1)
# pyglet.app.run()
Thread(target=pyglet.app.run()).start()
# target=pyglet.app.run()