本文整理匯總了Python中panel.Panel.draw方法的典型用法代碼示例。如果您正苦於以下問題:Python Panel.draw方法的具體用法?Python Panel.draw怎麽用?Python Panel.draw使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類panel.Panel
的用法示例。
在下文中一共展示了Panel.draw方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: GameWindow
# 需要導入模塊: from panel import Panel [as 別名]
# 或者: from panel.Panel import draw [as 別名]
#.........這裏部分代碼省略.........
## MOUSE SCROLL ##
def on_mouse_scroll(self, x, y, scroll_x, scroll_y):
if scroll_y > 0:
print "scrolled forward"
if scroll_y < 0:
print "scrolled backward"
## MOUSE DRAG ##
def on_mouse_drag(self, x, y, dx, dy, buttons, modifiers):
if buttons and mouse.LEFT:
#print 'Dragging Left Mouse'
pass
""" END EVENT HANDLING MUMBO JUMBO """
def check_player(self):
if self.player.inspace == 0:
self.player.velocity = 0
if self.player_rot[0] == 1:
self.player.rotate(self.player_rot[1])
if self.player_accel == 1:
self.player.accelerate(self.mapsize)
if self.player_accel == 0 and self.player.velocity > 0:
self.player.glide(self.mapsize)
if self.player_about == 1:
self.player.about()
def on_draw(self):
global Name
glClear(GL_COLOR_BUFFER_BIT)
if self.mainmenu.open == 0:
self.check_player()
if self.player.inspace == 1:
netinfo = self.net_client.netUpdate(self.player)
if self.bgcheck == 1 or self.bgcheck == -1:
self.background.draw(self.player.pos, self.bgcheck)
self.bgcheck *= -1
addplayer = 0
if netinfo[0] == "update":
crucial = pickle.loads(netinfo[1])
print "crucial data 3", crucial
for x in crucial:
if x != self.idnum:
if x in self.otherlist:
self.otherlist.get(x).setCrucial(crucial.get(x))
else:
self.playercount += 1
self.otherlist[x] = others.Other((self.width,self.height),self.panel.size)
self.otherlist.get(x).setCrucial(crucial.get(x))
if len(self.otherlist) > len(crucial):
for x in self.otherlist:
if self.otherlist.get(x).name not in plist:
self.otherlist.pop(x)
break
othersprites = []
for x in self.otherlist:
sprite = self.otherlist.get(x).draw(self.player.pos,self.visible_size,self.net_client.average_ping,self.player.name)
if sprite != None: