本文整理匯總了Python中GUI.addRoot方法的典型用法代碼示例。如果您正苦於以下問題:Python GUI.addRoot方法的具體用法?Python GUI.addRoot怎麽用?Python GUI.addRoot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GUI
的用法示例。
在下文中一共展示了GUI.addRoot方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testResize2
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import addRoot [as 別名]
def testResize2():
t2 = GUI.Text('resizebgman')
t2.font = 'resize.font'
GUI.addRoot(t2)
t2.verticalAnchor = 'TOP'
fontTestGUIs.append(t2)
return t2
示例2: showFDFont
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import addRoot [as 別名]
def showFDFont():
s = GUI.Simple('')
s.position = (0, 0, 0)
GUI.addRoot(s)
s.materialFX = 'SOLID'
s.textureName = 'fantasydemofont_20_font_rt'
s.size = (2, 2)
示例3: _displayGUI
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import addRoot [as 別名]
def _displayGUI(spaceName):
global g_gui
_clearGUI()
g_gui = GUI.Text("Entering offline space '%s'...\n%s" % (spaceName, INSTRUCTIONS))
g_gui.multiline = True
g_gui.horizontalAnchor = 'CENTER'
GUI.addRoot(g_gui)
示例4: __init__
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import addRoot [as 別名]
def __init__(self, config):
self.text = config.get('text', '')
if config.get('color', False):
self.color = '\c' + config.get('color')[1:] + 'FF;'
self.visible = config.get('visible', True)
self.x = config.get('x', 0)
self.y = config.get('y', 0)
self.hcentered = config.get('hcentered', False)
self.vcentered = config.get('vcentered', False)
background = os.path.join('scripts', 'client', 'mods', config.get('background')) \
if config.get('background', '') else ''
self.window = GUI.Window(background)
self.window.materialFX = "BLEND"
self.window.verticalAnchor = "TOP"
self.window.horizontalAnchor = "LEFT"
self.window.horizontalPositionMode = 'PIXEL'
self.window.verticalPositionMode = 'PIXEL'
self.window.heightMode = 'PIXEL'
self.window.widthMode = 'PIXEL'
self.window.width = config.get('width', 186)
self.window.height = config.get('height', 32)
GUI.addRoot(self.window)
self.shadow = GUI.Text('')
font = config.get('font', 'default_medium.font')
self.installItem(self.shadow, font)
self.label = GUI.Text('')
self.installItem(self.label, font)
self.setVisible(self.visible)
示例5: buttonClicked
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import addRoot [as 別名]
def buttonClicked(self):
t = GUI.Text('Button Clicked!')
t.colour = (255, 0, 0, 255)
t.position.y = 0.85
t.verticalAnchor = 'TOP'
GUI.addRoot(t)
BigWorld.callback(2.5, partial(_deleteComponent, t))
示例6: showFDFont
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import addRoot [as 別名]
def showFDFont():
s = GUI.Simple("")
s.position = (0, 0, 0)
GUI.addRoot(s)
s.materialFX = "SOLID"
s.textureName = "fantasydemofont_20_font_rt"
s.size = (2, 2)
示例7: active
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import addRoot [as 別名]
def active(self, state):
if self.isActive != state:
self.isActive = state
if state:
GUI.addRoot(self.component)
self.component.size = self.flashSize
else:
GUI.delRoot(self.component)
示例8: testResize1
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import addRoot [as 別名]
def testResize1():
t = GUI.Text("resize")
t.font = "resize.font"
GUI.addRoot(t)
fontTestGUIs.append(t)
t.verticalAnchor = "BOTTOM"
_showFont("resize.font")
return t
示例9: __createMainWindow
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import addRoot [as 別名]
def __createMainWindow(self, parentGUI):
self.__window = GUI.Window()
self.__window.horizontalAnchor = 'LEFT'
self.__window.verticalAnchor = 'TOP'
if parentGUI is None:
GUI.addRoot(self.__window)
else:
parentGUI.addChild(self.__window)
示例10: testWindow
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import addRoot [as 別名]
def testWindow():
BigWorld.camera(BigWorld.CursorCamera())
BigWorld.setCursor(GUI.mcursor())
GUI.mcursor().visible = True
clear()
w = GUI.load('gui/tests/window.gui')
GUI.addRoot(w)
return w
示例11: mouseButtonFocus
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import addRoot [as 別名]
def mouseButtonFocus():
"""
Tests exclusivity between focus and mouseButtonFocus. The test component
will not accept keyboard input, however it can receive mouse button events.
When testing, space-bar should initially do nothing until the component
has been clicked on with the mouse.
"""
clear()
GUI.addRoot(_FocusableComponent().component)
示例12: create
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import addRoot [as 別名]
def create(parent, pos):
s = GUI.Window('system/maps/col_white.bmp')
s.materialFX = 'SOLID'
s.width = 0.5
s.height = 0.5
s.position = pos
s.script = _MouseEventTester1(parent, s)
if parent is None:
GUI.addRoot(s)
else:
parent.addChild(s)
return s
示例13: __init__
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import addRoot [as 別名]
def __init__(self):
if not constants.IS_DEVELOPMENT:
return
CallbackDelayer.__init__(self)
self.__items = {}
self.__avgInfo = {}
self.__textGui = GUI.Text()
GUI.addRoot(self.__textGui)
self.__textGui.position = (0, -0.25, 0)
self.__textGui.multiline = True
self.clear()
self.__tickNames = {}
示例14: mouseEvents
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import addRoot [as 別名]
def mouseEvents():
"""
Tests all the possible mouse events that get sent to a component.
"""
clear()
r = GUI.Simple('')
r.width = 2.0
r.height = 2.0
GUI.addRoot(r)
_MouseEventTester1.create(r, (-0.5, 0.0, 0.5))
_MouseEventTester1.create(r, (0.5, 0.0, 0.5))
_MouseEventTester2.create(r, (0.0, -0.75, 0.0), (0, -1, 0), False)
_MouseEventTester2.create(r, (0.0, 0.75, 0.0), (0, 1, 0), True)
示例15: handleMouseEnterEvent
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import addRoot [as 別名]
def handleMouseEnterEvent(self, comp):
if self.gameStarted:
t = GUI.Text('YOU LOSE! Time: %.2f sec.' % (BigWorld.time() - self.gameStartTime))
t.colour = (255, 0, 0, 255)
t.position.z = 0.5
GUI.addRoot(t)
GUI.reSort()
BigWorld.callback(5, clear)
for root in GUI.roots():
if isinstance(root.script, _GameSquare):
root.script.gameStarted = False
return False