當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。