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


Python MainWindow.get方法代码示例

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


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

示例1: __init__

# 需要导入模块: from gui import MainWindow [as 别名]
# 或者: from gui.MainWindow import get [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

示例2: __init__

# 需要导入模块: from gui import MainWindow [as 别名]
# 或者: from gui.MainWindow import get [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

示例3: glFogf

# 需要导入模块: from gui import MainWindow [as 别名]
# 或者: from gui.MainWindow import get [as 别名]
            glFogf(GL_FOG_START, self.lightEnv.fogStart())
            glFogf(GL_FOG_END, self.lightEnv.fogEnd())
            glEnable(GL_FOG)
        else:
            glDisable(GL_FOG)

    def resize(self, (width, height)):
        glViewport(0, 0, width, height)
        glMatrixMode(GL_PROJECTION)
        glLoadIdentity()
        gluPerspective(45, 1.0 * width / height, 0.2, 100.0)
        glMatrixMode(GL_MODELVIEW)

        tdbWidth = 250
        tdbHeight = 8
        tdbY = MainWindow.get().size()[1] - tdbHeight * 20 - 30
        self._topTextDisplayer.setPosn((width / 2, 10))
        self._topTextDisplayer.invalidate()
        self._centeredTextDisplayer.setPosn((width / 2, height / 2))
        self._centeredTextDisplayer.invalidate()
        self.textDisplayerBox.setPosn((10, tdbY))
        self.textDisplayerBox.invalidate()
        self._battleMenu.setPosn((290, tdbY))
        self._battleMenu.invalidate()
        self._specialMenu.setPosn((420, tdbY))
        self._specialMenu.invalidate()
        self.cursorPosnDisplayer.invalidate()

    def setCursorPosn(self, x, y):
        self.cursor.setPosn(x, y)
开发者ID:jemofthewest,项目名称:GalaxyMage,代码行数:32,代码来源:ScenarioGUI.py


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