本文整理汇总了Python中pandac.PandaModules.TextNode.setCardDecal方法的典型用法代码示例。如果您正苦于以下问题:Python TextNode.setCardDecal方法的具体用法?Python TextNode.setCardDecal怎么用?Python TextNode.setCardDecal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandac.PandaModules.TextNode
的用法示例。
在下文中一共展示了TextNode.setCardDecal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: attachHostNameToSign
# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setCardDecal [as 别名]
def attachHostNameToSign(self, locator):
if self.hostName == "":
return
nameText = TextNode("nameText")
nameText.setCardAsMargin(0.1, 0.1, 0.1, 0.1)
nameText.setCardDecal(True)
nameText.setCardColor(1.0, 1.0, 1.0, 0.0)
r = 232.0 / 255.0
g = 169.0 / 255.0
b = 23.0 / 255.0
nameText.setTextColor(r, g, b, 1)
nameText.setAlign(nameText.ACenter)
nameText.setFont(ToontownGlobals.getBuildingNametagFont())
nameText.setShadowColor(0, 0, 0, 1)
nameText.setBin("fixed")
if TTLocalizer.BuildingNametagShadow:
nameText.setShadow(*TTLocalizer.BuildingNametagShadow)
nameWordWrap = 11.0
nameText.setWordwrap(nameWordWrap)
scaleMult = 0.48
houseName = self.hostName
nameText.setText(houseName)
textWidth = nameText.getWidth()
xScale = 1.0 * scaleMult
if textWidth > nameWordWrap:
xScale = nameWordWrap / textWidth * scaleMult
sign_origin = locator
namePlate = sign_origin.attachNewNode(nameText)
namePlate.setDepthWrite(0)
namePlate.setPos(0, 0, 0)
namePlate.setScale(xScale)
示例2: load
# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setCardDecal [as 别名]
def load(self):
from toontown.toonbase import ToontownGlobals
from pandac.PandaModules import TextNode
textNode = TextNode('moviedialogue')
textNode.setTextColor(0, 0, 0, 1)
textNode.setCardColor(1, 1, 1, 1)
textNode.setCardAsMargin(0, 0, 0, 0)
textNode.setCardDecal(True)
textNode.setWordwrap(27.0)
textNode.setAlign(TextNode.ACenter)
textNode.setFont(ToontownGlobals.getToonFont())
self._dialogueLabel = aspect2d.attachNewNode(textNode)
self._dialogueLabel.setScale(0.06, 0.06, 0.06)
self._dialogueLabel.setPos(0.32, 0, -0.75)
self._dialogueLabel.reparentTo(hidden)
示例3: load
# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setCardDecal [as 别名]
def load(self, loadModels = 1, arenaModel = 'partyCatchTree'):
self.notify.info('load()')
DistributedPartyCatchActivity.notify.debug('PartyCatch: load')
self.activityFSM = CatchActivityFSM(self)
self.defineConstants()
self.treesAndFence = loader.loadModel('phase_13/models/parties/%s' % arenaModel)
self.treesAndFence.setScale(0.9)
self.treesAndFence.find('**/fence_floor').setPos(0.0, 0.0, 0.1)
self.treesAndFence.reparentTo(self.root)
ground = self.treesAndFence.find('**/groundPlane')
ground.setBin('ground', 1)
DistributedPartyActivity.load(self)
exitText = TextNode('PartyCatchExitText')
exitText.setCardAsMargin(0.1, 0.1, 0.1, 0.1)
exitText.setCardDecal(True)
exitText.setCardColor(1.0, 1.0, 1.0, 0.0)
exitText.setText(TTLocalizer.PartyCatchActivityExit)
exitText.setTextColor(0.0, 8.0, 0.0, 0.9)
exitText.setAlign(exitText.ACenter)
exitText.setFont(ToontownGlobals.getBuildingNametagFont())
exitText.setShadowColor(0, 0, 0, 1)
exitText.setBin('fixed')
if TTLocalizer.BuildingNametagShadow:
exitText.setShadow(*TTLocalizer.BuildingNametagShadow)
exitTextLoc = self.treesAndFence.find('**/loc_exitSignText')
exitTextNp = exitTextLoc.attachNewNode(exitText)
exitTextNp.setDepthWrite(0)
exitTextNp.setScale(4)
exitTextNp.setZ(-.5)
self.sign.reparentTo(self.treesAndFence.find('**/loc_eventSign'))
self.sign.wrtReparentTo(self.root)
self.avatarNodePath = NodePath('PartyCatchAvatarNodePath')
self.avatarNodePath.reparentTo(self.root)
self._avatarNodePathParentToken = 3
base.cr.parentMgr.registerParent(self._avatarNodePathParentToken, self.avatarNodePath)
self.toonSDs = {}
self.dropShadow = loader.loadModelOnce('phase_3/models/props/drop_shadow')
self.dropObjModels = {}
if loadModels:
self.__loadDropModels()
self.sndGoodCatch = base.loadSfx('phase_4/audio/sfx/SZ_DD_treasure.ogg')
self.sndOof = base.loadSfx('phase_4/audio/sfx/MG_cannon_hit_dirt.ogg')
self.sndAnvilLand = base.loadSfx('phase_4/audio/sfx/AA_drop_anvil_miss.ogg')
self.sndPerfect = base.loadSfx('phase_4/audio/sfx/ring_perfect.ogg')
self.__textGen = TextNode('partyCatchActivity')
self.__textGen.setFont(ToontownGlobals.getSignFont())
self.__textGen.setAlign(TextNode.ACenter)
self.activityFSM.request('Idle')
示例4: load
# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setCardDecal [as 别名]
def load(self, loadModels = 1, arenaModel = 'partyCatchTree'):
self.notify.info('load()')
DistributedPartyCatchActivity.notify.debug('PartyCatch: load')
self.activityFSM = CatchActivityFSM(self)
if __dev__:
for o in xrange(3):
print {0: 'SPOTS PER PLAYER',
1: 'DROPS PER MINUTE PER SPOT DURING NORMAL DROP PERIOD',
2: 'DROPS PER MINUTE PER PLAYER DURING NORMAL DROP PERIOD'}[o]
for i in xrange(1, self.FallRateCap_Players + 10):
self.defineConstants(forceNumPlayers=i)
numDropLocations = self.DropRows * self.DropColumns
numDropsPerMin = 60.0 / self.DropPeriod
if o == 0:
spotsPerPlayer = numDropLocations / float(i)
print '%2d PLAYERS: %s' % (i, spotsPerPlayer)
elif o == 1:
numDropsPerMinPerSpot = numDropsPerMin / numDropLocations
print '%2d PLAYERS: %s' % (i, numDropsPerMinPerSpot)
elif i > 0:
numDropsPerMinPerPlayer = numDropsPerMin / i
print '%2d PLAYERS: %s' % (i, numDropsPerMinPerPlayer)
self.defineConstants()
self.treesAndFence = loader.loadModel('phase_13/models/parties/%s' % arenaModel)
self.treesAndFence.setScale(0.9)
self.treesAndFence.find('**/fence_floor').setPos(0.0, 0.0, 0.1)
self.treesAndFence.reparentTo(self.root)
ground = self.treesAndFence.find('**/groundPlane')
ground.setBin('ground', 1)
DistributedPartyActivity.load(self)
exitText = TextNode('PartyCatchExitText')
exitText.setCardAsMargin(0.1, 0.1, 0.1, 0.1)
exitText.setCardDecal(True)
exitText.setCardColor(1.0, 1.0, 1.0, 0.0)
exitText.setText(TTLocalizer.PartyCatchActivityExit)
exitText.setTextColor(0.0, 8.0, 0.0, 0.9)
exitText.setAlign(exitText.ACenter)
exitText.setFont(ToontownGlobals.getBuildingNametagFont())
exitText.setShadowColor(0, 0, 0, 1)
exitText.setBin('fixed')
if TTLocalizer.BuildingNametagShadow:
exitText.setShadow(*TTLocalizer.BuildingNametagShadow)
exitTextLoc = self.treesAndFence.find('**/loc_exitSignText')
exitTextNp = exitTextLoc.attachNewNode(exitText)
exitTextNp.setDepthWrite(0)
exitTextNp.setScale(4)
exitTextNp.setZ(-.5)
self.sign.reparentTo(self.treesAndFence.find('**/loc_eventSign'))
self.sign.wrtReparentTo(self.root)
self.avatarNodePath = NodePath('PartyCatchAvatarNodePath')
self.avatarNodePath.reparentTo(self.root)
self._avatarNodePathParentToken = 3
base.cr.parentMgr.registerParent(self._avatarNodePathParentToken, self.avatarNodePath)
self.toonSDs = {}
self.dropShadow = loader.loadModelOnce('phase_3/models/props/drop_shadow')
self.dropObjModels = {}
if loadModels:
self.__loadDropModels()
self.sndGoodCatch = base.loadSfx('phase_4/audio/sfx/SZ_DD_treasure.ogg')
self.sndOof = base.loadSfx('phase_4/audio/sfx/MG_cannon_hit_dirt.ogg')
self.sndAnvilLand = base.loadSfx('phase_4/audio/sfx/AA_drop_anvil_miss.ogg')
self.sndPerfect = base.loadSfx('phase_4/audio/sfx/ring_perfect.ogg')
self.__textGen = TextNode('partyCatchActivity')
self.__textGen.setFont(ToontownGlobals.getSignFont())
self.__textGen.setAlign(TextNode.ACenter)
self.activityFSM.request('Idle')
示例5: Game
# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setCardDecal [as 别名]
#.........这里部分代码省略.........
#add targeting to the world
self.setupTargeting()
#seed the random number generator
random.seed()
# configure the entire GUI
self.setupGUI()
# configure the title screen
self.setupTitleScreen()
def setupGUI(self):
GUIFont = loader.loadFont(FONTS_PATH + 'orbitron-medium.ttf')
"""
self.debugText = TextNode('debug')
self.debugText.setText("")
self.debugText.setAlign(TextNode.ALeft)
self.debugText.setFont(GUIFont)
dTextNodePath = aspect2d.attachNewNode(self.debugText)
dTextNodePath.setScale(0.075)
dTextNodePath.setPos(-1.2, 0, -0.9)
"""
#INTRO
self.introText = TextNode('intro')
self.introText.setText("")
self.introText.setAlign(TextNode.ALeft)
self.introText.setFont(GUIFont)
self.introText.setCardColor(0.1, 0.1, 0.1, 0.6)
self.introText.setCardAsMargin(0.5, 0.5, 0.5, 0.5)
self.introText.setCardDecal(True)
self.introText.setWordwrap(30.0)
self.iTextNodePath = aspect2d.attachNewNode(self.introText)
self.iTextNodePath.setScale(0.06)
self.iTextNodePath.setPos(-1.2, 0, -0.7)
#image is 171 x 323
self.leftMouseImage = OnscreenImage()
self.leftMouseImage.setImage(GUI_PATH + "mouse-icon-left.png")
self.leftMouseImage.setTransparency(1)
self.leftMousePath = aspect2d.attachNewNode(self.leftMouseImage.node())
self.rightMouseImage = OnscreenImage()
self.rightMouseImage.setImage(GUI_PATH + "mouse-icon-right.png")
self.rightMouseImage.setTransparency(1)
self.rightMousePath = aspect2d.attachNewNode(self.rightMouseImage.node())
self.middleMouseImage = OnscreenImage()
self.middleMouseImage.setImage(GUI_PATH + "mouse-icon-middle.png")
self.middleMouseImage.setTransparency(1)
self.middleMousePath = aspect2d.attachNewNode(self.middleMouseImage.node())
self.leftMousePath.setScale(.105882, 0, .2)
self.leftMousePath.setPos(1.1, 0, -0.75)
self.rightMousePath.setScale(.105882, 0, .2)
self.rightMousePath.setPos(1.1, 0, -0.75)
self.middleMousePath.setScale(.105882, 0, .2)
self.middleMousePath.setPos(1.1, 0, -0.75)
self.leftMousePath.hide()
self.rightMousePath.hide()
self.middleMousePath.hide()