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


Python Resources.font方法代码示例

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


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

示例1: __init__

# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import font [as 别名]
    def __init__(self, posn, width, nOptions):
        self.displayers = []
        self.options = []
        self.enabledOptions = []
        self.posn = posn
        for i in xrange(nOptions):
            td = TextDisplayer()
            td.setText("")
            td.setFont(Resources.font(size=16, bold=True))
            self.displayers.append(td)
        self.box = TextDisplayerBox(self.displayers,
                                    posn,
                                    width,
                                    nOptions)
        self.selectedOption = 0
        self._showing = False

        (textureID,
         image,
         renderedSize) = GLUtil.renderTextToTexture(Resources.font(size=16,
                                                                   bold=True),
                                                    (255,255,255,255),
                                                    ">",
                                                    False,
                                                    None)
        self.cursorImage = image
        self.cursorTexture = textureID
开发者ID:jemofthewest,项目名称:GalaxyMage,代码行数:29,代码来源:Sprite.py

示例2: __init__

# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import font [as 别名]
 def __init__(self):
     MainWindow.MainWindowDelegate.__init__(self)
     glClearColor(0.0, 0.0, 0.25, 0.0)
     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
     self._result = None
     self._gmVer = Sprite.TextDisplayer()
     self._gmVer.setText("GalaxyMage %s" % Main.__version__)
     self._gmVer.setFont(Resources.font(size=14, bold=False))
     self._label = Sprite.TextDisplayer()
     self._label.setFont(Resources.font(size=20, bold=True))
     self._menu = ScenarioChooserMenu()
     self._menu.setEnabled(True)
     self.addressEntry = Sprite.TextEntry()
     self.resize(MainWindow.get().size())
     self.fsm = ScenarioChooserFSM(self)
         
     self.scenario = None
     self.multiplayer = None
     self.serverAddress = None
     self.hostGame = None
     self.readyToStart = False
开发者ID:jemofthewest,项目名称:GalaxyMage,代码行数:23,代码来源:ScenarioChooser.py

示例3: __init__

# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import font [as 别名]
    def __init__(self, m):
        global _gui
        _gui = self
        
        self.lightEnv = Light.Environment()
        self.lightEnv.addLight(Light.White(brightness=0.5,
                               position=[20, 15, 100]))
        self.lightEnv.setFog(color=[0.4,0.4,0.5],
                start=10.0,
                end=30.0)
        self.setLighting()

        self.m = m
        
        for j in xrange(0, m.height):
            for i in xrange(0, m.width):
                self.compileMapSquareList(m.squares[i][j])

        self._highlightAlpha = 1.0  
        self.camera = Camera.Camera()

        tdbWidth = 250
        tdbHeight = 8
        tdbY = MainWindow.get().size()[1] - tdbHeight * 20 - 30
        center = (MainWindow.get().size()[0]/2,MainWindow.get().size()[1]/2)
        
        self.cursor = MapEditorCursor.MapEditorCursor(m)
        self._topMenu = MapEditorSprite.TopMenu((290, tdbY))
        self._tagMenu = MapEditorSprite.TagMenu((500, tdbY))
        self._tagMenu.setOptions(self.m.tags.keys())
        self._tagMenu.setShowing(False)
        self._chooseTagMenu = MapEditorSprite.TagMenu2((500, tdbY))
        self._chooseTagMenu.setOptions(self.m.tags.keys())
        self._chooseTagMenu.setShowing(False)
        self._addTagDialog = MapEditorSprite.AddTagDialog((50, 50),
            MainWindow.get().size()[0] - 130)
        self._editTagDialog = MapEditorSprite.EditTagDialog((50, 50),
            MainWindow.get().size()[0] - 130)
        self._saveDialog = MapEditorSprite.SaveDialog((50, 50),
            MainWindow.get().size()[0] - 130)
        self._tileInfoDisplayer = MapEditorSprite.TileInfoDisplayer((50, 50),
            MainWindow.get().size()[0] - 130)
        
        self.delegates = {}
        self.delegates['cursor'] = self.cursor
        self.delegates['topMenu'] = self._topMenu
        self.delegates['setTag'] = self._tagMenu
        self.delegates['addTag'] = self._addTagDialog
        self.delegates['editTag'] = self._editTagDialog
        self.delegates['chooseTag'] = self._chooseTagMenu
        self.delegates['save'] = self._saveDialog
        self.delegates['tileInfo'] = self._tileInfoDisplayer        
        self.activeDelegate = self.delegates['cursor']
        
        self.cursorPosnDisplayer = Sprite.CursorPosnDisplayer(self.cursor)
        self.tileTextureDisplayer = MapEditorSprite.TileTextureDisplayer(self.cursor)
        self.tileColorDisplayer = MapEditorSprite.TileColorDisplayer(self.cursor)
        self.tileTagDisplayer = MapEditorSprite.TileTagDisplayer(self.cursor)
        self.firstHeightDisplayer = MapEditorSprite.FirstHeightDisplayer(self.cursor,self.camera)
        self.secondHeightDisplayer = MapEditorSprite.SecondHeightDisplayer(self.cursor,self.camera)
        self.thirdHeightDisplayer = MapEditorSprite.ThirdHeightDisplayer(self.cursor,self.camera)
        self.textDisplayerBox = Sprite.TextDisplayerBox([
            self.tileTagDisplayer,
            self.tileTextureDisplayer,
            self.tileColorDisplayer,
            self.firstHeightDisplayer,
            self.secondHeightDisplayer,
            self.thirdHeightDisplayer
            ], (10, tdbY) , tdbWidth)
#        self._specialMenu = Sprite.SpecialMenu((420, tdbY))

        self._centeredTextDisplayer = Sprite.TextDisplayer()
        self._centeredTextDisplayer.setCenterX(True)
        self._centeredTextDisplayer.setCenterY(True)
        self._centeredTextDisplayer.setFont(Resources.font(size=36, bold=True))
        self._centeredTextDisplayer.setPosn(center)
        self._centeredTextDisplayer.setBorder(True)
        self._centeredTextDisplayer.setEnabled(False)

        self._topTextDisplayer = Sprite.TextDisplayer()
        self._topTextDisplayer.setCenterX(True)
        self._topTextDisplayer.setCenterY(False)
        self._topTextDisplayer.setFont(Resources.font(size=16, bold=True))
        self._topTextDisplayer.setPosn((MainWindow.get().size()[0]/2, 10))
        self._topTextDisplayer.setBorder(True)
        self._topTextDisplayer.setEnabled(False)

        
        self.highlights = {}
        self.cursorHighlightAlpha = 0.0
        self.highlightEnabled = False
        self._activeSquare = None

        self.normalObjects = [self.cursor]
        self.fgObjects = [self.cursorPosnDisplayer,
                          self.textDisplayerBox,
                          self._addTagDialog,
                          self._saveDialog,
                          self._tileInfoDisplayer,
                          self._editTagDialog,
#.........这里部分代码省略.........
开发者ID:jemofthewest,项目名称:GalaxyMage,代码行数:103,代码来源:MapEditorGUI.py

示例4: getFont

# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import font [as 别名]
 def getFont(self):
     return Resources.font(size=16, bold=True)
开发者ID:jemofthewest,项目名称:GalaxyMage,代码行数:4,代码来源:Sprite.py

示例5: __init__

# 需要导入模块: import Resources [as 别名]
# 或者: from Resources import font [as 别名]
    def __init__(self, client, scenario, faction):
        global _gui
        _gui = self

        self.scenario = scenario
        self.client = client
        self.faction = faction
        self.lightEnv = scenario.lightEnvironment()
        self.setLighting()
        self.focusedElement = None
        self.fsm = ScenarioGUIFSM(self)

        self.m = scenario.map()
        m = self.m
        for j in xrange(0, m.height):
            for i in xrange(0, m.width):
                self.compileMapSquareList(m.squares[i][j])

        self._highlightAlpha = 1.0
        self.camera = Camera.Camera()
        self.lastCameraRotation = None
        self.sortedMapSquares = []

        # FIXME: make a single chatbox object
        textColor = (64, 0, 0)
        self.textEntry = Sprite.TextEntry()
        self.textEntry.setPosn((10, 160))
        self.textEntry.setColor(textColor)  # FIXME: 0-255 color
        self.chatBox1 = Sprite.TextDisplayer()
        self.chatBox1.setPosn((10, 60))
        self.chatBox1.setColor(textColor)  # FIXME: 0-255 color
        self.chatBox1.setText("")
        self.chatBox2 = Sprite.TextDisplayer()
        self.chatBox2.setPosn((10, 80))
        self.chatBox2.setColor(textColor)  # FIXME: 0-255 color
        self.chatBox2.setText("")
        self.chatBox3 = Sprite.TextDisplayer()
        self.chatBox3.setPosn((10, 100))
        self.chatBox3.setColor(textColor)  # FIXME: 0-255 color
        self.chatBox3.setText("")
        self.chatBox4 = Sprite.TextDisplayer()
        self.chatBox4.setPosn((10, 120))
        self.chatBox4.setColor(textColor)  # FIXME: 0-255 color
        self.chatBox4.setText("")
        self.chatBox5 = Sprite.TextDisplayer()
        self.chatBox5.setPosn((10, 140))
        self.chatBox5.setColor(textColor)  # FIXME: 0-255 color
        self.chatBox5.setText("")

        self.cursor = Cursor.Cursor(m)
        self.cursorPosnDisplayer = Sprite.CursorPosnDisplayer(self.cursor)
        self.unitNameDisplayer = Sprite.UnitNameDisplayer(self.cursor)
        self.unitMovementDisplayer = Sprite.UnitMovementDisplayer(self.cursor)
        self.unitHPDisplayer = Sprite.UnitHPDisplayer(self.cursor)
        self.unitSPDisplayer = Sprite.UnitSPDisplayer(self.cursor)
        self.unitPhysicalDisplayer = Sprite.UnitPhysicalDisplayer(self.cursor)
        self.unitMagicalDisplayer = Sprite.UnitMagicalDisplayer(self.cursor)
        self.unitClassDisplayer = Sprite.UnitClassDisplayer(self.cursor)
        self.unitSpeedDisplayer = Sprite.UnitSpeedDisplayer(self.cursor)
        tdbWidth = 250
        tdbHeight = 8
        tdbY = MainWindow.get().size()[1] - tdbHeight * 20 - 30
        self.textDisplayerBox = Sprite.TextDisplayerBox(
            [
                self.unitNameDisplayer,
                self.unitClassDisplayer,
                self.unitHPDisplayer,
                self.unitSPDisplayer,
                self.unitMovementDisplayer,
                self.unitSpeedDisplayer,
                self.unitPhysicalDisplayer,
                self.unitMagicalDisplayer,
            ],
            (10, tdbY),
            tdbWidth,
        )
        self._battleMenu = Sprite.BattleMenu((290, tdbY))
        self._specialMenu = Sprite.SpecialMenu((420, tdbY))

        self._centeredTextDisplayer = Sprite.TextDisplayer()
        self._centeredTextDisplayer.setCenterX(True)
        self._centeredTextDisplayer.setCenterY(True)
        self._centeredTextDisplayer.setFont(Resources.font(size=36, bold=True))
        self._centeredTextDisplayer.setPosn((MainWindow.get().size()[0] / 2, MainWindow.get().size()[1] / 2))
        self._centeredTextDisplayer.setBorder(True)
        self._centeredTextDisplayer.setEnabled(False)

        self._topTextDisplayer = Sprite.TextDisplayer()
        self._topTextDisplayer.setCenterX(True)
        self._topTextDisplayer.setCenterY(False)
        self._topTextDisplayer.setFont(Resources.font(size=16, bold=True))
        self._topTextDisplayer.setPosn((MainWindow.get().size()[0] / 2, 10))
        self._topTextDisplayer.setBorder(True)
        self._topTextDisplayer.setEnabled(False)
        self._topTextDisplayerClearer = None

        self.units = scenario.units()
        self.battle = scenario.battle()
        self.unitDisplayers = []
        self.unitDisplayersDict = {}
#.........这里部分代码省略.........
开发者ID:jemofthewest,项目名称:GalaxyMage,代码行数:103,代码来源:ScenarioGUI.py


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