本文整理匯總了Python中pi3d.Camera.Camera.all_instances方法的典型用法代碼示例。如果您正苦於以下問題:Python Camera.all_instances方法的具體用法?Python Camera.all_instances怎麽用?Python Camera.all_instances使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pi3d.Camera.Camera
的用法示例。
在下文中一共展示了Camera.all_instances方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _loop_begin
# 需要導入模塊: from pi3d.Camera import Camera [as 別名]
# 或者: from pi3d.Camera.Camera import all_instances [as 別名]
def _loop_begin(self):
# TODO(rec): check if the window was resized and resize it, removing
# code from MegaStation to here.
if pi3d.USE_PYGAME:
import pygame # although done in __init__ ...python namespaces aarg!!!
if pygame.event.get(pygame.QUIT):
self.destroy()
elif pi3d.PLATFORM != pi3d.PLATFORM_PI and pi3d.PLATFORM != pi3d.PLATFORM_ANDROID:
n = xlib.XEventsQueued(self.opengl.d, xlib.QueuedAfterFlush)
for i in range(n):
xlib.XNextEvent(self.opengl.d, self.ev)
if self.ev.type == KeyPress or self.ev.type == KeyRelease:
self.event_list.append(self.ev)
elif self.ev.type == ClientMessage:
if (self.ev.xclient.data.l[0] == self.opengl.WM_DELETE_WINDOW.value):
self.destroy()
self.clear()
with self.lock:
self.sprites_to_load, to_load = set(), self.sprites_to_load
self.sprites.extend(to_load)
self._for_each_sprite(lambda s: s.load_opengl(), to_load)
if MARK_CAMERA_CLEAN_ON_EACH_LOOP:
from pi3d.Camera import Camera
#camera = Camera.instance()
#if camera is not None:
# camera.was_moved = False
cameras = Camera.all_instances()
if cameras is not None:
for camera in cameras:
camera.was_moved = False
if self.tidy_needed:
self._tidy()