当前位置: 首页>>代码示例>>Python>>正文


Python TextNode.setFont方法代码示例

本文整理汇总了Python中pandac.PandaModules.TextNode.setFont方法的典型用法代码示例。如果您正苦于以下问题:Python TextNode.setFont方法的具体用法?Python TextNode.setFont怎么用?Python TextNode.setFont使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pandac.PandaModules.TextNode的用法示例。


在下文中一共展示了TextNode.setFont方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: loadGUI

# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setFont [as 别名]
 def loadGUI(self):
     self.gui = loader.loadModel('phase_13/models/parties/trampolineGUI')
     self.gui.reparentTo(base.a2dTopLeft)
     self.gui.setPos(0.115, 0, -1)
     self.gui.hide()
     self.toonIndicator = self.gui.find('**/trampolineGUI_MovingBar')
     jumpLineLocator = self.gui.find('**/jumpLine_locator')
     guiBean = self.gui.find('**/trampolineGUI_GreenJellyBean')
     self.gui.find('**/trampolineGUI_GreenJellyBean').stash()
     self.guiBeans = [ guiBean.instanceUnderNode(jumpLineLocator, self.uniqueName('guiBean%d' % i)) for i in xrange(self.numJellyBeans) ]
     self.guiBeans[-1].setScale(1.5)
     heightTextNode = TextNode(self.uniqueName('TrampolineActivity.heightTextNode'))
     heightTextNode.setFont(ToontownGlobals.getSignFont())
     heightTextNode.setAlign(TextNode.ALeft)
     heightTextNode.setText('0.0')
     heightTextNode.setShadow(0.05, 0.05)
     heightTextNode.setShadowColor(0.0, 0.0, 0.0, 1.0)
     heightTextNode.setTextColor(1.0, 1.0, 1.0, 1.0)
     self.heightText = jumpLineLocator.attachNewNode(heightTextNode)
     self.heightText.setX(0.15)
     self.heightText.setScale(0.1)
     self.heightText.setAlphaScale(0.0)
     self.quitEarlyButtonModels = loader.loadModel('phase_3.5/models/gui/inventory_gui')
     quitEarlyUp = self.quitEarlyButtonModels.find('**//InventoryButtonUp')
     quitEarlyDown = self.quitEarlyButtonModels.find('**/InventoryButtonDown')
     quitEarlyRollover = self.quitEarlyButtonModels.find('**/InventoryButtonRollover')
     self.quitEarlyButton = DirectButton(parent=base.a2dTopRight, relief=None, text=TTLocalizer.PartyTrampolineQuitEarlyButton, text_fg=(1, 1, 0.65, 1), text_pos=(0, -0.23), text_scale=0.7, image=(quitEarlyUp, quitEarlyDown, quitEarlyRollover), image_color=(1, 0, 0, 1), image_scale=(20, 1, 11), pos=(-0.183, 0, -0.4), scale=0.09, command=self.leaveTrampoline)
     self.quitEarlyButton.stash()
     self.flashText = OnscreenText(text='', pos=(0.0, -0.45), scale=0.2, fg=(1.0, 1.0, 0.65, 1.0), align=TextNode.ACenter, font=ToontownGlobals.getSignFont(), mayChange=True)
     self.timer = PartyUtils.getNewToontownTimer()
     self.timer.posInTopRightCorner()
     return
开发者ID:CalebSmith376,项目名称:src,代码行数:34,代码来源:DistributedPartyTrampolineActivity.py

示例2: attachHostNameToSign

# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setFont [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)
开发者ID:XamarinDeveloper,项目名称:src,代码行数:33,代码来源:DistributedParty.py

示例3: loadSign

# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setFont [as 别名]
 def loadSign(self):
     actNameForSign = self.activityName
     if self.activityId == PartyGlobals.ActivityIds.PartyJukebox40:
         actNameForSign = PartyGlobals.ActivityIds.getString(PartyGlobals.ActivityIds.PartyJukebox)
     elif self.activityId == PartyGlobals.ActivityIds.PartyDance20:
         actNameForSign = PartyGlobals.ActivityIds.getString(PartyGlobals.ActivityIds.PartyDance)
     self.sign = self.root.attachNewNode('%sSign' % self.activityName)
     self.signModel = self.party.defaultSignModel.copyTo(self.sign)
     self.signFlat = self.signModel.find('**/sign_flat')
     self.signFlatWithNote = self.signModel.find('**/sign_withNote')
     self.signTextLocator = self.signModel.find('**/signText_locator')
     textureNodePath = getPartyActivityIcon(self.party.activityIconsModel, actNameForSign)
     textureNodePath.setPos(0.0, -0.02, 2.2)
     textureNodePath.setScale(2.35)
     textureNodePath.copyTo(self.signFlat)
     textureNodePath.copyTo(self.signFlatWithNote)
     text = TextNode('noteText')
     text.setTextColor(0.2, 0.1, 0.7, 1.0)
     text.setAlign(TextNode.ACenter)
     text.setFont(OTPGlobals.getInterfaceFont())
     text.setWordwrap(10.0)
     text.setText('')
     self.noteText = self.signFlatWithNote.attachNewNode(text)
     self.noteText.setPosHpr(self.signTextLocator, 0.0, 0.0, 0.2, 0.0, 0.0, 0.0)
     self.noteText.setScale(0.2)
     self.signFlatWithNote.stash()
     self.signTextLocator.stash()
开发者ID:ponyboy837,项目名称:SecretGitLolYoloSweg2015,代码行数:29,代码来源:DistributedPartyActivity.py

示例4: fontHasCharacters

# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setFont [as 别名]
 def fontHasCharacters(name, font = font):
     if font:
         tn = TextNode('NameCheck')
         tn.setFont(font)
         for c in name:
             if not tn.hasCharacter(ord(c)):
                 notify.info('name contains bad char: %s' % TextEncoder().encodeWtext(c))
                 return OTPLocalizer.NCBadCharacter % TextEncoder().encodeWtext(c)
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:10,代码来源:NameCheck.py

示例5: createDistanceLabel

# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setFont [as 别名]
 def createDistanceLabel(self, number, color):
     text = TextNode('distanceText-%d' % number)
     text.setAlign(TextNode.ACenter)
     text.setTextColor(color)
     text.setFont(ToontownGlobals.getSignFont())
     text.setText('10 ft')
     node = self.root.attachNewNode(text)
     node.setBillboardPointEye()
     node.setScale(2.5)
     node.setZ(5.0)
     return (node, text)
开发者ID:MasterLoopyBM,项目名称:c0d3,代码行数:13,代码来源:PartyCogActivity.py

示例6: createText

# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setFont [as 别名]
 def createText(self, number, position, color):
     text = TextNode('winText%d' % number)
     text.setAlign(TextNode.ACenter)
     text.setTextColor(color)
     text.setFont(ToontownGlobals.getSignFont())
     text.setText('')
     noteText = aspect2d.attachNewNode(text)
     noteText.setScale(0.2)
     noteText.setPos(position)
     noteText.stash()
     return (text, noteText)
开发者ID:MasterLoopyBM,项目名称:c0d3,代码行数:13,代码来源:PartyCogActivity.py

示例7: CatalogItemPage

# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setFont [as 别名]
class CatalogItemPage(NodePath):
    def __init__(self, parent, category, pageNum):
        NodePath.__init__(self, parent.attachNewNode(category))

        self.parent = parent
        self.pageNum = pageNum
        self.category = category
        self.catalogItems = []
        self.itemFrames = []
        self.textNode = None

    def addCatalogItem(self, item):
        if not item in self.catalogItems:
            self.catalogItems.append(item)

    def setCatalogItems(self, catalogItems):
        self.catalogItems = catalogItems

    def generatePage(self):
        pageText = '%s - %s' % (self.category, self.pageNum)
        self.textNode = TextNode(pageText)
        self.textNode.setText(pageText)
        self.textNode.setFont(ToontownGlobals.getInterfaceFont())
        self.textNode = self.attachNewNode(self.textNode)
        self.textNode.setPos(*CatalogGlobals.ItemPageTextLoc)
        self.textNode.setScale(CatalogGlobals.ItemPageTextScale)
        self.textNode.setColor(0, 0, 0, 1)
        for (x, item) in enumerate(self.catalogItems):
            itemFrame = CatalogItemPanel(parent=self, parentCatalogScreen=self.parent, item=item)
            itemFrame.load()
            itemFrame.setPos(*CatalogGlobals.CatalogPropPos[x])
            self.itemFrames.append(itemFrame)

    def lockItems(self):
        for itemFrame in self.itemFrames:
            itemFrame.lockItem()

    def updateItems(self, gifting):
        for itemFrame in self.itemFrames:
            itemFrame.updateButtons(gifting)

    def cleanup(self):
        for item in self.catalogItems:
            if hasattr(item, 'destroy'):
                item.destroy()

        for itemFrame in self.itemFrames:
            itemFrame.destroy()

        NodePath.removeNode(self)
开发者ID:CalebSmith376,项目名称:src,代码行数:52,代码来源:CatalogItemPage.py

示例8: load

# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setFont [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)
开发者ID:BmanGames,项目名称:Toontown-Level-Editor,代码行数:17,代码来源:CogdoUtil.py

示例9: load

# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setFont [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')
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:50,代码来源:DistributedPartyCatchActivity.py

示例10: __init__

# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setFont [as 别名]
 def __init__(self, name, parent, pos = (0.0, 0.0, -0.5), scale = 0.09, color = (1.0, 1.0, 0, 1), sfx = None):
     self.color = color
     self._displaySfx = sfx
     textNode = TextNode('messageLabel.' + name)
     textNode.setTextColor(self.color)
     textNode.setAlign(TextNode.ACenter)
     textNode.setFont(ToontownGlobals.getSignFont())
     textNode.setShadow(0.06, 0.06)
     textNode.setShadowColor(0.5, 0.5, 0.5, 1.0)
     self.pos = pos
     self.scale = scale
     self.messageLabel = parent.attachNewNode(textNode)
     self.messageLabel.setPos(self.pos)
     self.messageLabel.setScale(self.scale)
     self.messageLabel.stash()
     self.transitionInterval = Sequence(name='%s.transitionInterval' % self.__class__.__name__)
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:18,代码来源:CogdoGameMessageDisplay.py

示例11: createText

# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setFont [as 别名]
    def createText(self, text, pos=(0.0, 0.0), align=TextNode.ACenter, scale=None, colour=None):
        if colour is None:
            colour = self.colour
        if scale is None:
            scale = self.default_element_scale

        text_node = TextNode("text")
        text_node.setText(text)
        text_node.setGlyphScale(scale)
        text_node.setAlign(align)
        text_node.setFont(self.unicodefont)
        text_node.setTextColor(colour[0], colour[1], colour[2], colour[3])

        generated_text = text_node.generate()
        text_node_path = render2d.attachNewNode(generated_text)
        text_node_path.setPos(pos[0], 0.0, pos[1])
        return text_node, text_node_path
开发者ID:garym,项目名称:Azure--Infinite-Skies,代码行数:19,代码来源:gui.py

示例12: __init__

# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setFont [as 别名]
    def __init__(self, description, needed, icon):
        NodePath.__init__(self, 'objective-%s' % id(self))

        self.needed = needed
        self.visible = False

        self.fadeInTrack = None
        self.fadeOutTrack = None

        gui = loader.loadModel('phase_5/models/cogdominium/tt_m_gui_csa_flyThru')
        self.background = gui.find('**/*background').copyTo(self)
        self.background.setScale(2.5)
        gui.removeNode()

        self.icon = icon.copyTo(self.background)
        self.icon.setScale(0.08)
        self.icon.setPos(-0.167, 0, -0.002)

        text = TextNode('challenge')
        text.setText('Challenge')
        text.setFont(ToontownGlobals.getSignFont())
        text.setTextColor(0.95, 0.95, 0, 1)
        self.objText = self.background.attachNewNode(text)
        self.objText.setScale(0.03)
        self.objText.setPos(-0.04, 0.0, 0.02)

        text = TextNode('description')
        text.setText(description)
        text.setFont(ToontownGlobals.getSignFont())
        text.setTextColor(0.95, 0.95, 0, 1)
        text.setAlign(TextNode.ACenter)
        self.objText = self.background.attachNewNode(text)
        self.objText.setScale(0.015)
        self.objText.setPos(0.048, 0.0, -0.009)

        self.progressBar = DirectWaitBar(guiId='ChallengeProgressBar', parent=self.background, frameSize=(-0.11, 0.11, -0.007, 0.007), pos=(0.048, 0, -0.0338), text='')
        self.progressBar['range'] = needed

        self.progressText = DirectLabel(guiId='ChallengeProgressText', parent=self.progressBar, relief=None, pos=(0, 0, -0.0048), text='', textMayChange=1, text_scale=0.014, text_fg=(0.03, 0.83, 0, 1), text_align=TextNode.ACenter, text_font=ToontownGlobals.getSignFont())

        self.updateProgress(0)

        self.reparentTo(base.a2dBottomLeft)
        self.stash()
开发者ID:ToontownModder101,项目名称:Toontown-Offline-Squirting-Flower-Modded-,代码行数:46,代码来源:ExperimentChallengeGUI.py

示例13: DistributedPartyCatchActivity

# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setFont [as 别名]

#.........这里部分代码省略.........
            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')

    def __loadDropModels(self):
        for objType in PartyGlobals.DropObjectTypes:
            model = loader.loadModel(objType.modelPath)
开发者ID:frogtongue,项目名称:tonguefrog,代码行数:70,代码来源:DistributedPartyCatchActivity.py

示例14: load

# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setFont [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')
开发者ID:frogtongue,项目名称:tonguefrog,代码行数:69,代码来源:DistributedPartyCatchActivity.py

示例15: __init__

# 需要导入模块: from pandac.PandaModules import TextNode [as 别名]
# 或者: from pandac.PandaModules.TextNode import setFont [as 别名]

#.........这里部分代码省略.........
        pass  # Inheritors should override this method.

    def setAvatar(self, avatar):
        self.avatar = avatar

    def getAvatar(self):
        return self.avatar

    def setIcon(self, icon):
        self.icon = icon

    def getIcon(self):
        return self.icon

    def setChatButton(self, chatButton):
        self.chatButton = chatButton

    def getChatButton(self):
        return self.chatButton

    def hasChatButton(self):
        if (self.chatBalloonType == NametagGlobals.CHAT_BALLOON) and self.chatHidden:
            return False
        if (self.chatBalloonType == NametagGlobals.THOUGHT_BALLOON) and self.thoughtHidden:
            return False
        return self.chatButton != NametagGlobals.noButton

    def setChatReversed(self, chatReversed):
        self.chatReversed = chatReversed

    def getChatReversed(self):
        return self.chatReversed

    def setFont(self, font):
        self.font = font
        if self.font is not None:
            self.textNode.setFont(self.font)
        self.update()

    def getFont(self):
        return self.font

    def setChatFont(self, chatFont):
        self.chatFont = chatFont
        if self.chatFont is not None:
            self.chatTextNode.setFont(self.chatFont)
        self.update()

    def getChatFont(self):
        return self.chatFont

    def setChatType(self, chatType):
        self.chatType = chatType

    def getChatType(self):
        return self.chatType

    def setChatBalloonType(self, chatBalloonType):
        self.chatBalloonType = chatBalloonType

    def getChatBalloonType(self):
        return self.chatBalloonType

    def setNametagColor(self, nametagColor):
        self.nametagColor = nametagColor
开发者ID:Teku16,项目名称:Toontown-Crystal-Master,代码行数:69,代码来源:Nametag.py


注:本文中的pandac.PandaModules.TextNode.setFont方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。