mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
*** empty log message ***
This commit is contained in:
parent
ee8f10684d
commit
6eaf59ba32
@ -1,11 +1,9 @@
|
|||||||
from ShowBaseGlobal import *
|
from ShowBaseGlobal import *
|
||||||
from DirectObject import *
|
from DirectObject import *
|
||||||
from GuiGlobals import *
|
from GuiGlobals import *
|
||||||
import GuiManager
|
|
||||||
import GuiLabel
|
import GuiLabel
|
||||||
import GuiButton
|
import GuiButton
|
||||||
|
|
||||||
guiMgr = GuiManager.GuiManager.getPtr(base.win, base.mak.node(), base.renderGui.node())
|
|
||||||
|
|
||||||
class Button(DirectObject):
|
class Button(DirectObject):
|
||||||
|
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
from ShowBaseGlobal import *
|
from ShowBaseGlobal import *
|
||||||
from DirectObject import *
|
from DirectObject import *
|
||||||
import GuiManager
|
from GuiGlobals import *
|
||||||
import GuiFrame
|
import GuiFrame
|
||||||
import Vec3
|
import Vec3
|
||||||
|
|
||||||
guiMgr = GuiManager.GuiManager.getPtr(base.win, base.mak.node(), base.renderGui.node())
|
|
||||||
font = (loader.loadModelOnce("phase_3/models/fonts/ttf-comic")).node()
|
|
||||||
|
|
||||||
class Frame(DirectObject):
|
class Frame(DirectObject):
|
||||||
|
|
||||||
# special methods
|
# special methods
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
# GuiGlobals.py : global info for the gui package
|
# GuiGlobals.py : global info for the gui package
|
||||||
|
|
||||||
from ShowBaseGlobal import *
|
from ShowBaseGlobal import *
|
||||||
|
import GuiManager
|
||||||
|
|
||||||
|
guiMgr = GuiManager.GuiManager.getPtr(base.win, base.mak.node(),
|
||||||
|
base.renderGui.node())
|
||||||
|
|
||||||
font = loader.loadModelNode("models/fonts/ttf-comic")
|
font = loader.loadModelNode("models/fonts/ttf-comic")
|
||||||
|
|
||||||
@ -10,3 +14,4 @@ def getDefaultFont():
|
|||||||
def setDefaultFont(newFont):
|
def setDefaultFont(newFont):
|
||||||
global font
|
global font
|
||||||
font = newFont
|
font = newFont
|
||||||
|
|
||||||
|
@ -38,10 +38,9 @@ class OnscreenText(PandaObject, NodePath):
|
|||||||
self.assign(textNodePath)
|
self.assign(textNodePath)
|
||||||
|
|
||||||
# position ourselves
|
# position ourselves
|
||||||
self.setXY(x, y)
|
self.setPos(x, y)
|
||||||
|
|
||||||
# assume 4:3 aspect ratio
|
self.setScale(0.069)
|
||||||
self.setScale( 0.069, 1.0, 0.069)
|
|
||||||
self.isClean = 0
|
self.isClean = 0
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -66,13 +65,19 @@ class OnscreenText(PandaObject, NodePath):
|
|||||||
"""
|
"""
|
||||||
self.node().setText(string)
|
self.node().setText(string)
|
||||||
|
|
||||||
|
def setScale(self, scale):
|
||||||
def setXY(self, x, y):
|
"""setScale(self, float)
|
||||||
|
Override NodePath setScale to account for aspect ratio
|
||||||
|
"""
|
||||||
|
# assume 4:3 aspect ratio
|
||||||
|
NodePath.setScale(self, scale, 1.0, scale * (4.0/3.0))
|
||||||
|
|
||||||
|
def setPos(self, x, y):
|
||||||
"""setPos(self, float, float)
|
"""setPos(self, float, float)
|
||||||
Position the onscreen text in 2d screen space
|
Position the onscreen text in 2d screen space
|
||||||
"""
|
"""
|
||||||
# render2d has x across and z up
|
# render2d has x across and z up
|
||||||
self.setPos(x, 0.0, y)
|
NodePath.setPos(self, x, 0.0, y)
|
||||||
|
|
||||||
def setColor(self, color):
|
def setColor(self, color):
|
||||||
self.textNode.setCardColor(color[0],color[1],color[2],color[3])
|
self.textNode.setCardColor(color[0],color[1],color[2],color[3])
|
||||||
|
@ -2,11 +2,8 @@ from ShowBaseGlobal import *
|
|||||||
from DirectObject import *
|
from DirectObject import *
|
||||||
from GuiGlobals import *
|
from GuiGlobals import *
|
||||||
import GuiSign
|
import GuiSign
|
||||||
import GuiManager
|
|
||||||
import GuiLabel
|
import GuiLabel
|
||||||
|
|
||||||
guiMgr = GuiManager.GuiManager.getPtr(base.win, base.mak.node(), base.renderGui.node())
|
|
||||||
|
|
||||||
class Sign(DirectObject):
|
class Sign(DirectObject):
|
||||||
|
|
||||||
def __init__(self, name, label=None, font=getDefaultFont()):
|
def __init__(self, name, label=None, font=getDefaultFont()):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user