*** empty log message ***
This commit is contained in:
parent
bded9a817d
commit
06256def02
|
|
@ -1,5 +1,6 @@
|
|||
from ShowBaseGlobal import *
|
||||
from DirectObject import *
|
||||
from GuiGlobals import *
|
||||
import GuiManager
|
||||
import GuiLabel
|
||||
import GuiButton
|
||||
|
|
@ -8,7 +9,7 @@ guiMgr = GuiManager.GuiManager.getPtr(base.win, base.mak.node(), base.renderGui.
|
|||
|
||||
class Button(DirectObject):
|
||||
|
||||
def __init__(self, name, label=None, font=interfaceFont):
|
||||
def __init__(self, name, label=None, font=getDefaultFont()):
|
||||
self.name = name
|
||||
# if no label given, use the button name
|
||||
if (label == None):
|
||||
|
|
|
|||
|
|
@ -93,3 +93,10 @@ class ForceAcknowledge(StateData.StateData):
|
|||
def __handleOk(self):
|
||||
self.doneStatus = "ok"
|
||||
messenger.send(self.doneEvent)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
# GuiGlobals.py : global info for the gui package
|
||||
|
||||
from ShowBaseGlobal import *
|
||||
|
||||
font = loader.loadModelNode("models/fonts/ttf-comic")
|
||||
|
||||
def getDefaultFont():
|
||||
return font
|
||||
|
||||
def setDefaultFont(newFont):
|
||||
global font
|
||||
font = newFont
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
"""OnscreenText module: contains the OnscreenText class"""
|
||||
|
||||
from PandaObject import *
|
||||
from GuiGlobals import *
|
||||
|
||||
class OnscreenText(PandaObject, NodePath):
|
||||
|
||||
Font = loader.loadModelOnce("phase_3/models/fonts/ttf-comic").node()
|
||||
|
||||
def __init__(self, string, x=0.0, y=0.0):
|
||||
"""__init__(self, string, float=0.0, float=0.0)
|
||||
def __init__(self, string, x=0.0, y=0.0, font=getDefaultFont()):
|
||||
"""__init__(self, string, float=0.0, float=0.0,
|
||||
font=GuiGlobals.getDefaultFont())
|
||||
Make a text node from string, put it into the 2d sg and place
|
||||
it at x, y in screen space
|
||||
"""
|
||||
|
|
@ -24,7 +24,7 @@ class OnscreenText(PandaObject, NodePath):
|
|||
textNode.setCardAsMargin(0.1, 0.1, 0.1, 0.1)
|
||||
# textNode.setFrameColor(0.0, 0.0, 0.0, 1.0)
|
||||
# textNode.setFrameAsMargin(0.15, 0.15, 0.15, 0.15)
|
||||
textNode.setFont(OnscreenText.Font)
|
||||
textNode.setFont(font)
|
||||
textNode.setText(string)
|
||||
textNode.clearCardBorder()
|
||||
textNode.clearFrame()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
from ShowBaseGlobal import *
|
||||
from GuiGlobals import *
|
||||
import PandaObject
|
||||
import Frame
|
||||
import GuiFrame
|
||||
|
|
@ -11,7 +12,7 @@ import Sign
|
|||
class ScrollingLabel(PandaObject.PandaObject):
|
||||
|
||||
# special methods
|
||||
def __init__(self, name, itemList, font=interfaceFont):
|
||||
def __init__(self, name, itemList, font=getDefaultFont()):
|
||||
|
||||
self.name = name
|
||||
self.eventName = self.name
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
from ShowBaseGlobal import *
|
||||
from DirectObject import *
|
||||
from GuiGlobals import *
|
||||
import GuiSign
|
||||
import GuiManager
|
||||
import GuiLabel
|
||||
|
|
@ -8,7 +9,7 @@ guiMgr = GuiManager.GuiManager.getPtr(base.win, base.mak.node(), base.renderGui.
|
|||
|
||||
class Sign(DirectObject):
|
||||
|
||||
def __init__(self, name, label=None, font=interfaceFont):
|
||||
def __init__(self, name, label=None, font=getDefaultFont()):
|
||||
self.name = name
|
||||
# label in this case means GuiLabel
|
||||
if not label:
|
||||
|
|
|
|||
|
|
@ -18,7 +18,3 @@ __builtin__.taskMgr = base.taskMgr
|
|||
__builtin__.eventMgr = base.eventMgr
|
||||
__builtin__.messenger = base.messenger
|
||||
__builtin__.config = base.config
|
||||
|
||||
# Pointer to interface font
|
||||
import ToontownGlobals
|
||||
__builtin__.interfaceFont = ToontownGlobals.getInterfaceFont()
|
||||
|
|
|
|||
Loading…
Reference in New Issue