本文整理汇总了Python中pygame.surface.Surface.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Surface.__init__方法的具体用法?Python Surface.__init__怎么用?Python Surface.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pygame.surface.Surface
的用法示例。
在下文中一共展示了Surface.__init__方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pygame.surface import Surface [as 别名]
# 或者: from pygame.surface.Surface import __init__ [as 别名]
def __init__(self, size, game):
Surface.__init__(self, size)
self.width, self.height = size
self.game = game
self._load_images()
self.font = pygame.font.SysFont("Comic Sans MS", int(0.09 * self.width))
self.hsfont = pygame.font.SysFont("Comic Sans MS", int(0.09 * self.width))
示例2: __init__
# 需要导入模块: from pygame.surface import Surface [as 别名]
# 或者: from pygame.surface.Surface import __init__ [as 别名]
def __init__(self, image, movement_speed):
Surface.__init__(self, image.get_size())
self.image = image
self.blit(self.image, (0, 0))
self.movement_speed = movement_speed
示例3: __init__
# 需要导入模块: from pygame.surface import Surface [as 别名]
# 或者: from pygame.surface.Surface import __init__ [as 别名]
def __init__(self, size, score_manager):
Surface.__init__(self, size)
self.background = None
self.width, self.height = size
self.font = pygame.font.SysFont("Comic Sans MS", int(0.09 * self.width))
self.font2 = pygame.font.SysFont("Comic Sans MS", int(0.07 * self.width))
self.score_manager = score_manager
self._load_images()
self._init_board()
示例4: __init__
# 需要导入模块: from pygame.surface import Surface [as 别名]
# 或者: from pygame.surface.Surface import __init__ [as 别名]
def __init__(self, image):
Surface.__init__(self, (300, 300))
self.rotation = 0
self.originalImage = image
self.cubeSide = CubeSide(image, (100, 100), 0)
self.imageLocation = (100, 100)
示例5: redraw
# 需要导入模块: from pygame.surface import Surface [as 别名]
# 或者: from pygame.surface.Surface import __init__ [as 别名]
def redraw(self, rotation_x, rotation_y):
resize_width = 0
resize_height = 0
if (rotation_x + self.originalRotationX > 360):
resize_width = (rotation_x + self.originalRotationX * 1.0) % 90.0
resize_width = int(resize_width * 100)
Surface.__init__(self, self.get_size(), pygame.SRCALPHA)
Transform.skew_surface(self.originalImage, 0, -rotation_y), (0, 0)
self.blit(pygame.transform.scale(Transform.skew_surface(self.originalImage, 0, -rotation_y), (resize_width, self.get_size()[1])), (-rotation_x,0))
示例6: __init__
# 需要导入模块: from pygame.surface import Surface [as 别名]
# 或者: from pygame.surface.Surface import __init__ [as 别名]
def __init__(self, size, game):
Surface.__init__(self, size)
self.width, self.height = size
self.game = game
self._load_images()
self.font = pygame.font.SysFont("Comic Sans MS", int(0.09 * self.width))
self.font2 = pygame.font.SysFont("Comic Sans MS", int(0.035 * self.width))
self.select_column_text = self.font.render("Select column", 1, (255, 255, 0))
self.select_school_text = self.font.render("Select school", 1, (255, 255, 0))
self.move_text = self.font2.render("MOVE", 1, (255, 0, 0))
示例7: __init__
# 需要导入模块: from pygame.surface import Surface [as 别名]
# 或者: from pygame.surface.Surface import __init__ [as 别名]
def __init__(self, size, game, acceleration=ACCELERATION):
Surface.__init__(self, size)
self.width, self.height = size
self.game = game
self.player = Player(self, (size[0]/2, size[1]*0.8))
self.obstacle_manager = ObstacleManager(self,
OBSTACLE_BASE_SPEED,
MAX_OBSTACLES,
CollisionStrategyFactory(self.game),
self.player)
self.children = [self.player, self.obstacle_manager]
self.acceleration = acceleration
示例8: __init__
# 需要导入模块: from pygame.surface import Surface [as 别名]
# 或者: from pygame.surface.Surface import __init__ [as 别名]
def __init__(self, size):
Surface.__init__(self, size)
self.width, self.height = size
self._load_title()
self._load_fire()
self._init_board()