本文整理汇总了Python中toontown.shtiker.KartPage.KartViewer.load方法的典型用法代码示例。如果您正苦于以下问题:Python KartViewer.load方法的具体用法?Python KartViewer.load怎么用?Python KartViewer.load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.shtiker.KartPage.KartViewer
的用法示例。
在下文中一共展示了KartViewer.load方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ReturnKartDlg
# 需要导入模块: from toontown.shtiker.KartPage import KartViewer [as 别名]
# 或者: from toontown.shtiker.KartPage.KartViewer import load [as 别名]
class ReturnKartDlg(DirectFrame):
notify = DirectNotifyGlobal.directNotify.newCategory('KartShopGuiMgr.ReturnKartDlg')
def __init__(self, doneEvent):
self.modelScale = 1
model = loader.loadModel('phase_6/models/gui/ReturnKartPanel')
DirectFrame.__init__(
self,
relief=None,
state='normal',
geom=model,
geom_scale=self.modelScale,
frameSize=(-1, 1, -1, 1),
pos=(0, 0, -0.01),
text=TTLocalizer.KartShop_ConfirmReturnKart,
text_wordwrap=11,
text_scale=KS_TEXT_SIZE_SMALL * 0.9,
text_pos=(0, -0.26))
self.initialiseoptions(KartShopGuiMgr.ReturnKartDlg)
self.cancelButton = DirectButton(
parent=self,
relief=None,
image=(model.find('**/CancelButtonUp'), model.find('**/CancelButtonDown'), model.find('**/CancelButtonRollover')),
geom=model.find('**/CancelIcon'),
scale=self.modelScale,
pressEffect=False,
command=lambda : messenger.send(doneEvent, [RK_OPTIONS.Cancel]))
self.okButton = DirectButton(
parent=self,
relief=None,
image=(model.find('**/CheckButtonUp'), model.find('**/CheckButtonDown'), model.find('**/CheckButtonRollover')),
geom=model.find('**/CheckIcon'),
scale=self.modelScale,
pressEffect=False,
command=lambda : messenger.send(doneEvent, [RK_OPTIONS.ReturnKart]))
oldDNA = list(base.localAvatar.getKartDNA())
for d in xrange(len(oldDNA)):
if d == KartDNA.bodyType:
continue
else:
oldDNA[d] = InvalidEntry
self.kartView = KartViewer(oldDNA, parent=self)
self.kartView.setPos(model.find('**/KartViewerFrame').getPos())
self.kartView.load(model, 'KartViewerFrame', [], [], None)
self.kartView.setBounds(-0.38, 0.38, -.04, 0.49)
self.kartView.setBgColor(1.0, 1.0, 0.8, 1.0)
self.kartView.show()
model.removeNode()
self.initialize = True
return
def destroy(self):
if self.initialize:
self.kartView.destroy()
DirectFrame.destroy(self)
示例2: BoughtKartDlg
# 需要导入模块: from toontown.shtiker.KartPage import KartViewer [as 别名]
# 或者: from toontown.shtiker.KartPage.KartViewer import load [as 别名]
class BoughtKartDlg(DirectFrame):
notify = DirectNotifyGlobal.directNotify.newCategory('KartShopGuiMgr.BoughtKartDlg')
def __init__(self, doneEvent, kartID):
self.modelScale = 1
model = loader.loadModel('phase_6/models/gui/BoughtKartPanel')
kartInfo = getKartTypeInfo(kartID)
name = kartInfo[KartInfo.name]
DirectFrame.__init__(
self,
relief=None,
state='normal',
geom=model,
geom_scale=self.modelScale,
frameSize=(-1, 1, -1, 1),
pos=(0, 0, -0.01),
text=TTLocalizer.KartShop_ConfirmBoughtTitle,
text_wordwrap=26,
text_scale=KS_TEXT_SIZE_SMALL,
text_pos=(0, -0.26))
self.initialiseoptions(KartShopGuiMgr.BoughtKartDlg)
self.ticketDisplay = DirectLabel(
parent=self,
relief=None,
text=str(base.localAvatar.getTickets()),
text_scale=KS_TEXT_SIZE_SMALL,
text_fg=(0.95, 0.95, 0.0, 1.0),
text_shadow=(0, 0, 0, 1),
text_pos=(0.43, -0.5),
text_font=ToontownGlobals.getSignFont())
self.okButton = DirectButton(
parent=self,
relief=None,
image=(model.find('**/CheckButtonUp'), model.find('**/CheckButtonDown'), model.find('**/CheckButtonRollover')),
geom=model.find('**/CheckIcon'),
scale=self.modelScale,
pressEffect=False,
command=lambda : messenger.send(doneEvent, [BTK_OPTIONS.Ok]))
self.kartView = KartViewer([kartID, -1, -1, -1, -1, -1, -1, -1, -1], parent=self)
self.kartView.setPos(model.find('**/KartViewerFrame').getPos())
self.kartView.load(model, 'KartViewerFrame', [], [])
self.kartView.setBounds(-0.38, 0.38, -.0425, 0.49)
self.kartView.setBgColor(1.0, 1.0, 0.8, 1.0)
self.kartView.show()
model.removeNode()
self.initialize = True
return
def destroy(self):
if self.initialize:
self.kartView.destroy()
DirectFrame.destroy(self)
示例3: BuyKartDlg
# 需要导入模块: from toontown.shtiker.KartPage import KartViewer [as 别名]
# 或者: from toontown.shtiker.KartPage.KartViewer import load [as 别名]
class BuyKartDlg(DirectFrame):
notify = DirectNotifyGlobal.directNotify.newCategory('KartShopGuiMgr.BuyKartDlg')
def __init__(self, doneEvent):
self.modelScale = 1
model = loader.loadModel('phase_6/models/gui/BuyKartPanel')
self.unownedKartList = KartDict.keys()
if base.localAvatar.hasKart():
k = base.localAvatar.getKartBodyType()
if k in self.unownedKartList:
self.unownedKartList.remove(k)
self.numKarts = len(self.unownedKartList)
self.curKart = 0
DirectFrame.__init__(
self,
relief=None,
state='normal',
geom=model,
geom_scale=self.modelScale,
frameSize=(-1, 1, -1, 1),
pos=(0, 0, -0.01),
text_wordwrap=26,
text_scale=KS_TEXT_SIZE_BIG,
text_pos=(0, 0))
self.initialiseoptions(KartShopGuiMgr.BuyKartDlg)
self.ticketDisplay = DirectLabel(
parent=self,
relief=None,
text=str(base.localAvatar.getTickets()),
text_scale=KS_TEXT_SIZE_SMALL,
text_fg=(0.95, 0.95, 0.0, 1.0),
text_shadow=(0, 0, 0, 1),
text_pos=(0.44, -0.55),
text_font=ToontownGlobals.getSignFont())
self.buyKartButton = DirectButton(
parent=self,
relief=None,
image=(model.find('**/BuyKartButtonUp'), model.find('**/BuyKartButtonDown'), model.find('**/BuyKartButtonRollover'), model.find('**/BuyKartButtonDisabled')),
scale=self.modelScale,
text=TTLocalizer.KartShop_BuyKart,
text_scale=KS_TEXT_SIZE_BIG,
text_pos=(0, -.534),
pressEffect=False,
command=lambda : messenger.send(doneEvent, [self.unownedKartList[self.curKart]]))
self.cancelButton = DirectButton(
parent=self,
relief=None,
image=(model.find('**/CancelButtonUp'), model.find('**/CancelButtonDown'), model.find('**/CancelButtonRollover')),
geom=model.find('**/CancelIcon'),
scale=self.modelScale,
pressEffect=False,
command=lambda : messenger.send(doneEvent, [BK_OPTIONS.Cancel]))
self.arrowLeftButton = DirectButton(
parent=self,
relief=None,
image=(model.find('**/ArrowLeftButtonUp'), model.find('**/ArrowLeftButtonDown'), model.find('**/ArrowLeftButtonRollover'), model.find('**/ArrowLeftButtonInactive')),
scale=self.modelScale,
pressEffect=False,
command=self.__handleKartChange,
extraArgs=[-1])
self.arrowRightButton = DirectButton(
parent=self,
relief=None,
image=(model.find('**/ArrowRightButtonUp'), model.find('**/ArrowRightButtonDown'), model.find('**/ArrowRightButtonRollover'), model.find('**/ArrowRightButtonInactive')),
scale=self.modelScale,
pressEffect=False,
command=self.__handleKartChange,
extraArgs=[1])
self.kartView = KartViewer([self.curKart, -1, -1, -1, -1, -1, -1, -1, -1], parent=self)
self.kartView.setPos(model.find('**/KartViewerFrame').getPos())
self.kartView.load(model, 'KartViewerFrame', ['rotate_right_up',
'rotate_right_down',
'rotate_right_roll',
'rotate_right_down',
(0.255, -.054)], ['rotate_left_up',
'rotate_left_down',
'rotate_left_roll',
'rotate_left_down',
(-.24, -.054)], (0, -.055))
self.kartView.setBounds(-0.38, 0.38, 0.0035, 0.53)
self.kartView.setBgColor(1.0, 1.0, 0.8, 1.0)
self.showKart()
self.initialize = True
model.removeNode()
return
def showKart(self):
self.buyKartButton.configure(text=TTLocalizer.KartShop_BuyKart)
self.buyKartButton.configure(text_scale=KS_TEXT_SIZE_BIG)
if self.numKarts > 0:
info = getKartTypeInfo(self.unownedKartList[self.curKart])
description = info[KartInfo.name]
cost = TTLocalizer.KartShop_Cost % info[KartInfo.cost]
self.kartDescription = DirectButton(
parent=self,
relief=None,
scale=self.modelScale,
text=description,
text_pos=(0, -.29),
text_scale=KS_TEXT_SIZE_SMALL,
#.........这里部分代码省略.........
示例4: BuyAccessoryDlg
# 需要导入模块: from toontown.shtiker.KartPage import KartViewer [as 别名]
# 或者: from toontown.shtiker.KartPage.KartViewer import load [as 别名]
class BuyAccessoryDlg(DirectFrame):
notify = DirectNotifyGlobal.directNotify.newCategory('KartShopGuiMgr.buyAccessoryDlg')
def __init__(self, doneEvent):
self.modelScale = 1
model = loader.loadModel('phase_6/models/gui/BuyAccessoryPanel')
self.doneEvent = doneEvent
DirectFrame.__init__(self, relief=None, state='normal', geom=model, geom_scale=self.modelScale, frameSize=(-1, 1, -1, 1), pos=(0, 0, -0.01), text_wordwrap=26, text_scale=0.1, text_fg=Vec4(0.36, 0.94, 0.93, 1.0), text_pos=(0, 0))
self.initialiseoptions(KartShopGuiMgr.BuyAccessoryDlg)
self.ticketDisplay = DirectLabel(
parent=self,
relief=None,
text=str(base.localAvatar.getTickets()),
text_scale=KS_TEXT_SIZE_SMALL,
text_fg=(0.95, 0.95, 0.0, 1.0),
text_shadow=(0, 0, 0, 1),
text_pos=(0.42, -0.6),
text_font=ToontownGlobals.getSignFont())
self.arrowLeftButton = DirectButton(
parent=self,
relief=None,
image=(model.find('**/ArrowLeftButtonUp'), model.find('**/ArrowLeftButtonDown'), model.find('**/ArrowLeftButtonRollover'), model.find('**/ArrowLeftButtonInactive')),
scale=self.modelScale,
text_pos=(0, 0),
text_scale=0.1,
pressEffect=False,
command=self.__handleAccessoryChange,
extraArgs=[-1])
self.arrowRightButton = DirectButton(
parent=self,
relief=None,
image=(model.find('**/ArrowRightButtonUp'), model.find('**/ArrowRightButtonDown'), model.find('**/ArrowRightButtonRollover'), model.find('**/ArrowRightButtonInactive')),
scale=self.modelScale,
text_pos=(0, 0),
text_scale=0.1,
pressEffect=False,
command=self.__handleAccessoryChange,
extraArgs=[1])
self.cancelButton = DirectButton(
parent=self,
relief=None,
image=(model.find('**/CancelButtonUp'), model.find('**/CancelButtonDown'), model.find('**/CancelButtonRollover')),
geom=model.find('**/CancelIcon'),
scale=self.modelScale,
command=lambda : messenger.send(doneEvent, [BA_OPTIONS.Cancel]),
pressEffect=False)
self.decalAccButton = DirectButton(
parent=self,
relief=None,
image=(model.find('**/DecalButtonUp'), model.find('**/DecalButtonDown'), model.find('**/DecalButtonRollover'), model.find('**/DecalButtonDown')),
scale=self.modelScale,
pressEffect=False,
command=self.__handleAccessoryTypeChange,
extraArgs=[KartDNA.decalType])
self.spoilerAccButton = DirectButton(
parent=self,
relief=None,
image=(model.find('**/SpoilerButtonUp'), model.find('**/SpoilerButtonDown'), model.find('**/SpoilerButtonRollover'), model.find('**/SpoilerButtonDown')),
scale=self.modelScale,
pressEffect=False,
command=self.__handleAccessoryTypeChange,
extraArgs=[KartDNA.spType])
self.eBlockAccButton = DirectButton(
parent=self,
relief=None,
image=(model.find('**/EBlockButtonUp'), model.find('**/EBlockButtonDown'), model.find('**/EBlockButtonRollover'), model.find('**/EBlockButtonDown')),
scale=self.modelScale,
pressEffect=False,
command=self.__handleAccessoryTypeChange,
extraArgs=[KartDNA.ebType])
self.rearAccButton = DirectButton(
parent=self,
relief=None,
image=(model.find('**/RearButtonUp'), model.find('**/RearButtonDown'), model.find('**/RearButtonRollover'), model.find('**/RearButtonDown')),
scale=self.modelScale,
pressEffect=False,
command=self.__handleAccessoryTypeChange,
extraArgs=[KartDNA.bwwType])
self.frontAccButton = DirectButton(
parent=self,
relief=None,
image=(model.find('**/FrontButtonUp'), model.find('**/FrontButtonDown'), model.find('**/FrontButtonRollover'), model.find('**/FrontButtonDown')),
scale=self.modelScale,
text_pos=(0, 0),
text_scale=0.1,
pressEffect=False,
command=self.__handleAccessoryTypeChange,
extraArgs=[KartDNA.fwwType])
self.rimAccButton = DirectButton(
parent=self,
relief=None,
image=(model.find('**/RimButtonUp'), model.find('**/RimButtonDown'), model.find('**/RimButtonRollover'), model.find('**/RimButtonDown')),
scale=self.modelScale,
pressEffect=False,
command=self.__handleAccessoryTypeChange,
extraArgs=[KartDNA.rimsType])
self.paintAccButton = DirectButton(
parent=self,
relief=None,
image=(model.find('**/PaintButtonUp'), model.find('**/PaintButtonDown'), model.find('**/PaintButtonRollover'), model.find('**/PaintButtonDown')),
#.........这里部分代码省略.........