當前位置: 首頁>>代碼示例>>Python>>正文


Python Panel.draw方法代碼示例

本文整理匯總了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:
開發者ID:remremrem,項目名稱:EV-Tribute,代碼行數:70,代碼來源:game.py


注:本文中的panel.Panel.draw方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。