*** empty log message ***

This commit is contained in:
gregw 2001-03-07 21:36:22 +00:00
parent bded9a817d
commit 06256def02
7 changed files with 30 additions and 12 deletions

View File

@ -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):

View File

@ -93,3 +93,10 @@ class ForceAcknowledge(StateData.StateData):
def __handleOk(self):
self.doneStatus = "ok"
messenger.send(self.doneEvent)

View File

@ -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

View File

@ -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()

View File

@ -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

View File

@ -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:

View File

@ -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()