当前位置: 首页>>代码示例>>Python>>正文


Python Rect.__init__方法代码示例

本文整理汇总了Python中pygame.Rect.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Rect.__init__方法的具体用法?Python Rect.__init__怎么用?Python Rect.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pygame.Rect的用法示例。


在下文中一共展示了Rect.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from pygame import Rect [as 别名]
# 或者: from pygame.Rect import __init__ [as 别名]
 def __init__(self,midbottom):
     Rect.__init__(self,self.rect)
     self.midbottom  = midbottom
     self.dx         = random()-0.5
     self.X          = self.x
     self.dy         = 4+random()
     self.Y          = self.y
开发者ID:amoliu,项目名称:curriculum-deep-RL,代码行数:9,代码来源:enemy.py

示例2: __init__

# 需要导入模块: from pygame import Rect [as 别名]
# 或者: from pygame.Rect import __init__ [as 别名]
 def __init__(self,img,x,y):
     self.img = img.copy()
     Rect.__init__(self,self.img.get_rect(center=(x,y)))
     self.ttl = 150
     self.deltaX = 0
     self.deltaY = 1
     self.X = self.x
     self.Y = self.y
开发者ID:amoliu,项目名称:curriculum-deep-RL,代码行数:10,代码来源:bonus.py

示例3: __init__

# 需要导入模块: from pygame import Rect [as 别名]
# 或者: from pygame.Rect import __init__ [as 别名]
 def __init__(self, pos):
     Rect.__init__(self, pos, (0, 0))
     self.pos = pos
     self.radius = 0
     self.radiusmax = 500
     self.pow = 40
     self.step = self.radiusmax / self.pow
     self.img = None
开发者ID:strin,项目名称:curriculum-deep-RL,代码行数:10,代码来源:ship.py

示例4: __init__

# 需要导入模块: from pygame import Rect [as 别名]
# 或者: from pygame.Rect import __init__ [as 别名]
 def __init__(self,image):
     self.scr = display.get_surface()
     w,h = image.get_size()
     w //= 3
     self.images = [image.subsurface(x,0,w,h).copy() for x in range(0,w*3,w)]
     Rect.__init__(self,0,0,w,h)
     self.ACTIV = True
     self.status = False
     self.over = False
开发者ID:CaptainFalco,项目名称:_init_.py,代码行数:11,代码来源:Buttons.py

示例5: __init__

# 需要导入模块: from pygame import Rect [as 别名]
# 或者: from pygame.Rect import __init__ [as 别名]
 def __init__(self, dimensions, pos, text, text_colour=(0, 0, 0),
              text_font=(None, 50), bg_colour=None):
     Rect.__init__(self, (pos[0] - dimensions[0] / 2,
                          pos[1] - dimensions[1] / 2), dimensions)
     self.dimensions = dimensions
     self.pos = pos
     self.text = text
     self.text_colour = text_colour
     self.text_font = text_font
     self.create_text_avatar()
     self.bg_colour = bg_colour
开发者ID:tborisova,项目名称:hackfmi4,代码行数:13,代码来源:gui_elements.py

示例6: __init__

# 需要导入模块: from pygame import Rect [as 别名]
# 或者: from pygame.Rect import __init__ [as 别名]
    def __init__(self, l, t=0, w=0, h=0, angle=0):
        self.angle = angle #yay - angles :D

        #now we need to init Rect - this just makes sure that is done right...
        if type(l) is type(()) or type(l) is type([]):
            Rect.__init__(self, l, t)
        elif type(l) is type(1) or type(l) is type(1.0):
            Rect.__init__(self, l, t, w, h)
        else:
            Rect.__init__(self, l)
开发者ID:AjaxVM,项目名称:pyglibs,代码行数:12,代码来源:rect.py

示例7: __init__

# 需要导入模块: from pygame import Rect [as 别名]
# 或者: from pygame.Rect import __init__ [as 别名]
 def __init__(self,rect,alpha,delta):
     Rect.__init__(self,rect)
     self.surface = Surface(self.size,SRCALPHA)
     self.alpha   = alpha
     self.delta   = delta
开发者ID:conallCurran,项目名称:MassEffectShooter,代码行数:7,代码来源:layer.py

示例8: __init__

# 需要导入模块: from pygame import Rect [as 别名]
# 或者: from pygame.Rect import __init__ [as 别名]
 def __init__(self,rect,alpha,delta):
     Rect.__init__(self,rect)
     self.surface = Surface(self.size, flags=SRCALPHA, depth=32)
     self.alpha   = alpha
     self.delta   = delta
开发者ID:amoliu,项目名称:curriculum-deep-RL,代码行数:7,代码来源:layer.py

示例9: __init__

# 需要导入模块: from pygame import Rect [as 别名]
# 或者: from pygame.Rect import __init__ [as 别名]
 def __init__(self, x, y, rect):
     Rect.__init__(self, rect)
     self.x = x
     self.y = y
开发者ID:bitcraft,项目名称:pyweek14,代码行数:6,代码来源:oldtilemap.py


注:本文中的pygame.Rect.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。