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


Python Resources.image方法代码示例

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


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

示例1: __init__

# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import image [as 别名]
    def __init__(self, fullscreen, width):
        """Initializes the main window."""
        global _mainWindow
        _mainWindow = self

        self._input = Input.Input(0)

        self._limitFPS = True

        self._fullscreen = fullscreen
        self._fullscreenSize = self._chooseDisplaySize()
        self._defaultSize = (width, width*3/4)

        if fullscreen:
            self._size = self._fullscreenSize
        else:
            self._size = self._defaultSize
        
        self._fpsDisplayer = Sprite.FPSDisplayer()
        self._delegate = None
        self._soundEnabled = True

        pygame.display.set_icon(Resources.image("icon-32"))
        self._setDisplayMode()
        self._resize()
        self._initOpenGL()

        if self._fullscreen:
            pygame.mouse.set_pos((0, 0))
开发者ID:jemofthewest,项目名称:GalaxyMage,代码行数:31,代码来源:MainWindow.py

示例2: __init__

# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import image [as 别名]
    def __init__(self, unit, delay=0.0, attackStyle="melee"):
        # Number of frames of the attack animation
        self._maxFrame = unit.getSprites(attackStyle).__len__()
        if self._maxFrame == 0:
            attackStyle = 'standing'
            self._maxFrame = unit.getSprites(attackStyle).__len__()
        
        # Load the textures
        self._unitHand = []
        self._texture = []
        for image in unit.getSprites(attackStyle):
            self._texture.append(GLUtil.makeTexture(Resources.image(image))[0])
            self._unitHand.append(Resources.spriteConfig.hand(image))
        
        # Load the weapon textures
        self._wtexture = None
        self._weapGrip = None
        if unit.weapon() != None:
            wimage = unit.weapon().getSprites('standing')[0]
            if wimage != None:
                self._wtexture = GLUtil.makeTexture(Resources.image(wimage))[0]
                self._weapGrip = Resources.spriteConfig.grip(wimage)
        else:
            wimage = None
            
        # Load the over textures
        self._otexture = []
        if wimage != None:
            oimages = unit.getOverSprites(attackStyle)
            if len(oimages) < self._maxFrame:
                oimages = []
            for image in oimages:
                self._otexture.append(
                    GLUtil.makeTexture(Resources.image(image))[0])

            
        self._unitdisplayer = ScenarioGUI.get().unitDisplayer(unit)        
        self._unitdisplayer.Acting()
        self._time = -delay
        self._frame = 0
开发者ID:jemofthewest,项目名称:GalaxyMage,代码行数:42,代码来源:Sprite.py


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