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


Python Surface.__init__方法代码示例

本文整理汇总了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))
开发者ID:mlefebvre,项目名称:ArcadeCS2014,代码行数:9,代码来源:game_over_menu.py

示例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
开发者ID:eeue56,项目名称:realrpg,代码行数:9,代码来源:surfaces.py

示例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()
开发者ID:mlefebvre,项目名称:ArcadeCS2014,代码行数:11,代码来源:scoreboard.py

示例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)
开发者ID:DuhProgrammer13,项目名称:3D-Pygame,代码行数:11,代码来源:cube.py

示例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))
开发者ID:DuhProgrammer13,项目名称:3D-Pygame,代码行数:12,代码来源:cube.py

示例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))
开发者ID:mlefebvre,项目名称:ArcadeCS2014,代码行数:12,代码来源:main_menu.py

示例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
开发者ID:mlefebvre,项目名称:ArcadeCS2014,代码行数:14,代码来源:gameboard.py

示例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()
开发者ID:mlefebvre,项目名称:ArcadeCS2014,代码行数:8,代码来源:top_menu.py


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