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


Python ToontownGlobals.getBuildingNametagFont方法代码示例

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


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

示例1: attachHostNameToSign

# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import getBuildingNametagFont [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

示例2: setupNametag

# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import getBuildingNametagFont [as 别名]
 def setupNametag(self):
     if not self.wantsNametag():
         return
         
     if self.doorIndex != 0:
         # Avoid duplicated nametags (eg hq doors)
         return
         
     if self.nametag == None:
         self.nametag = NametagGroup()
         self.nametag.setFont(ToontownGlobals.getBuildingNametagFont())
         
         if TTLocalizer.BuildingNametagShadow:
             self.nametag.setShadow(*TTLocalizer.BuildingNametagShadow)
             
         self.nametag.setContents(Nametag.CName)
         self.nametag.setColorCode(NametagGroup.CCToonBuilding)
         self.nametag.setActive(0)
         self.nametag.setAvatar(self.getDoorNodePath())
         self.nametag.setObjectCode(self.block)
         
         name = self.cr.playGame.dnaStore.getTitleFromBlockNumber(self.block)
         self.nametag.setName(name)
         
         self.nametag.manage(base.marginManager)
开发者ID:Teku16,项目名称:MikeyTheRepository,代码行数:27,代码来源:DistributedDoor.py

示例3: getFontByName

# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import getBuildingNametagFont [as 别名]
 def getFontByName(self, fontname):
     if fontname == 'toon':
         return ToontownGlobals.getToonFont()
     elif fontname == 'building':
         return ToontownGlobals.getBuildingNametagFont()
     elif fontname == 'minnie':
         return ToontownGlobals.getMinnieFont()
     elif fontname == 'suit':
         return ToontownGlobals.getSuitFont()
     else:
         return MagicWordManager.MagicWordManager.getFontByName(self, fontname)
开发者ID:ponyboy837,项目名称:Toontown-2003-Server,代码行数:13,代码来源:ToontownMagicWordManager.py

示例4: load

# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import getBuildingNametagFont [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

示例5: setupNametag

# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import getBuildingNametagFont [as 别名]
 def setupNametag(self):
     if self.nametag == None:
         self.nametag = NametagGroup()
         self.nametag.setFont(ToontownGlobals.getBuildingNametagFont())
         if TTLocalizer.BuildingNametagShadow:
             self.nametag.setShadow(*TTLocalizer.BuildingNametagShadow)
         self.nametag.setContents(Nametag.CName)
         self.nametag.setColorCode(NametagGroup.CCSuitBuilding)
         self.nametag.setActive(0)
         self.nametag.setAvatar(self.getElevatorModel())
         name = self.cr.playGame.dnaStore.getTitleFromBlockNumber(self.bldg.block)
         if not name:
             name = TTLocalizer.CogsInc
         else:
             name += TTLocalizer.CogsIncExt
         self.nametag.setName(name)
         self.nametag.manage(base.marginManager)
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:19,代码来源:DistributedElevatorExt.py

示例6: setupNametag

# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import getBuildingNametagFont [as 别名]
 def setupNametag(self):
     if not self.wantsNametag():
         return
     if self.nametag == None:
         self.nametag = NametagGroup()
         self.nametag.setFont(ToontownGlobals.getBuildingNametagFont())
         if TTLocalizer.BuildingNametagShadow:
             self.nametag.setShadow(*TTLocalizer.BuildingNametagShadow)
         self.nametag.setContents(Nametag.CName)
         self.nametag.setColorCode(NametagGroup.CCToonBuilding)
         self.nametag.setActive(0)
         self.nametag.setAvatar(self.getDoorNodePath())
         self.nametag.setObjectCode(self.block)
         name = self.cr.playGame.dnaData.getBlock(self.block).title
         self.nametag.setName(name)
         self.nametag.manage(base.marginManager)
     return
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:19,代码来源:DistributedDoor.py

示例7: __setupNametag

# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import getBuildingNametagFont [as 别名]
 def __setupNametag(self):
     if self.nametag:
         self.clearNametag()
     if self.name == '':
         houseName = ''
     else:
         houseName = TTLocalizer.AvatarsHouse % TTLocalizer.GetPossesive(self.name)
     self.nametag = NametagGroup()
     self.nametag.setFont(ToontownGlobals.getBuildingNametagFont())
     if TTLocalizer.BuildingNametagShadow:
         self.nametag.setShadow(*TTLocalizer.BuildingNametagShadow)
     self.nametag.setContents(Nametag.CName)
     self.nametag.setColorCode(NametagGroup.CCHouseBuilding)
     self.nametag.setActive(0)
     self.nametag.setAvatar(self.house)
     self.nametag.setObjectCode(self.doId)
     self.nametag.setName(houseName)
     self.nametag.manage(base.marginManager)
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:20,代码来源:DistributedHouse.py

示例8: __setupNamePlateCustom

# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import getBuildingNametagFont [as 别名]
 def __setupNamePlateCustom(self):
     self.notify.debug('__setupNamePlateCustom')
     if self.namePlate:
         self.namePlate.removeNode()
         del self.namePlate
         self.namePlate = None
     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 = self.randomGenerator.random()
     g = self.randomGenerator.random()
     b = self.randomGenerator.random()
     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)
     nameText.setWordwrap(16.0)
     xScale = 1.0
     numLines = 0
     if self.name == '':
         return
     else:
         houseName = TTLocalizer.AvatarsHouse % TTLocalizer.GetPossesive(self.name)
     nameText.setText(houseName)
     self.nameText = nameText
     textHeight = nameText.getHeight() - 2
     textWidth = nameText.getWidth()
     xScale = 1.0
     if textWidth > 16:
         xScale = 16.0 / textWidth
     sign_origin = self.house.find('**/sign_origin')
     pos = sign_origin.getPos()
     sign_origin.setPosHpr(pos[0], pos[1], pos[2] + 0.15 * textHeight, 90, 0, 0)
     self.namePlate = sign_origin.attachNewNode(self.nameText)
     self.namePlate.setDepthWrite(0)
     self.namePlate.setPos(0, -0.05, 0)
     self.namePlate.setScale(xScale)
     return nameText
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:44,代码来源:DistributedHouse.py

示例9: setupNametag

# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import getBuildingNametagFont [as 别名]
 def setupNametag(self):
     if self.nametag == None:
         self.nametag = NametagGroup()
         self.nametag.setFont(ToontownGlobals.getBuildingNametagFont())
         if TTLocalizer.BuildingNametagShadow:
             self.nametag.setShadow(*TTLocalizer.BuildingNametagShadow)
         self.nametag.hideChat()
         self.nametag.hideThought()
         nametagColor = NametagGlobals.NametagColors[NametagGlobals.CCSuitBuilding]
         self.nametag.setNametagColor(nametagColor)
         self.nametag.setActive(False)
         self.nametag.setAvatar(self.getElevatorModel())
         name = self.cr.playGame.dnaStore.getTitleFromBlockNumber(self.bldg.block)
         if not name:
             name = TTLocalizer.CogsInc
         else:
             name += TTLocalizer.CogsIncExt
         self.nametag.setText(name)
         self.nametag.manage(base.marginManager)
         self.nametag.updateAll()
开发者ID:Teku16,项目名称:Toontown-Crystal-Master,代码行数:22,代码来源:DistributedElevatorExt.py

示例10: __setupNametag

# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import getBuildingNametagFont [as 别名]
 def __setupNametag(self):
     if self.nametag:
         self.clearNametag()
     if self.name == '':
         houseName = ''
     else:
         houseName = TTLocalizer.AvatarsHouse % TTLocalizer.GetPossesive(self.name)
     self.nametag = NametagGroup()
     self.nametag.setNametag3d(None)
     self.nametag.setFont(ToontownGlobals.getBuildingNametagFont())
     if TTLocalizer.BuildingNametagShadow:
         self.nametag.setShadow(*TTLocalizer.BuildingNametagShadow)
     self.nametag.hideChat()
     self.nametag.hideThought()
     nametagColor = NametagGlobals.NametagColors[NametagGlobals.CCToonBuilding]
     self.nametag.setNametagColor(nametagColor)
     self.nametag.setActive(False)
     self.nametag.setAvatar(self.house)
     self.nametag.setText(houseName)
     self.nametag.manage(base.marginManager)
     self.nametag.updateAll()
开发者ID:CalebSmith376,项目名称:src,代码行数:23,代码来源:DistributedHouse.py

示例11: __setupFloorMat

# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import getBuildingNametagFont [as 别名]
 def __setupFloorMat(self, changeColor = True):
     if self.floorMat:
         self.floorMat.removeNode()
         del self.floorMat
         self.floorMat = None
     mat = self.house.find('**/mat')
     if changeColor:
         mat.setColor(0.4, 0.357, 0.259, 1.0)
     color = HouseGlobals.houseColors[self.housePosInd]
     matText = TextNode('matText')
     matText.setTextColor(color[0], color[1], color[2], 1)
     matText.setAlign(matText.ACenter)
     matText.setFont(ToontownGlobals.getBuildingNametagFont())
     matText.setShadowColor(0, 0, 0, 1)
     matText.setBin('fixed')
     if TTLocalizer.BuildingNametagShadow:
         matText.setShadow(*TTLocalizer.BuildingNametagShadow)
     matText.setWordwrap(10.0)
     xScale = 1.0
     numLines = 0
     if self.name == '':
         return
     else:
         houseName = TTLocalizer.AvatarsHouse % TTLocalizer.GetPossesive(self.name)
     matText.setText(houseName)
     self.matText = matText
     textHeight = matText.getHeight() - 2
     textWidth = matText.getWidth()
     xScale = 1.0
     if textWidth > 8:
         xScale = 8.0 / textWidth
     mat_origin = self.house.find('**/mat_origin')
     pos = mat_origin.getPos()
     mat_origin.setPosHpr(pos[0] - 0.15 * textHeight, pos[1], pos[2], 90, -90, 0)
     self.floorMat = mat_origin.attachNewNode(self.matText)
     self.floorMat.setDepthWrite(0)
     self.floorMat.setPos(0, -.025, 0)
     self.floorMat.setScale(0.45 * xScale)
     return
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:41,代码来源:DistributedHouse.py

示例12: load

# 需要导入模块: from toontown.toonbase import ToontownGlobals [as 别名]
# 或者: from toontown.toonbase.ToontownGlobals import getBuildingNametagFont [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


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