当前位置: 首页>>代码示例>>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;未经允许,请勿转载。