本文整理汇总了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
示例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
示例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
示例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
示例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
示例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)
示例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
示例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
示例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