本文整理汇总了Python中toontown.shtiker.KartPage.KartViewer.setBounds方法的典型用法代码示例。如果您正苦于以下问题:Python KartViewer.setBounds方法的具体用法?Python KartViewer.setBounds怎么用?Python KartViewer.setBounds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.shtiker.KartPage.KartViewer
的用法示例。
在下文中一共展示了KartViewer.setBounds方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ReturnKartDlg
# 需要导入模块: from toontown.shtiker.KartPage import KartViewer [as 别名]
# 或者: from toontown.shtiker.KartPage.KartViewer import setBounds [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 setBounds [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 setBounds [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 setBounds [as 别名]
#.........这里部分代码省略.........
scale=self.modelScale,
text=TTLocalizer.KartShop_BuyAccessory,
text_pos=(0, -.57),
text_scale=KS_TEXT_SIZE_SMALL,
pressEffect=False,
command=self.__handleBuyAccessory)
if not base.cr.isPaid():
def showTeaserPanel():
TeaserPanel(pageName='kartingAccessories')
self.buyAccessoryButton['command'] = showTeaserPanel
self.ownedAccList = base.localAvatar.getKartAccessoriesOwned()
while -1 in self.ownedAccList:
self.ownedAccList.remove(-1)
self.unownedAccDict = getAccessoryDictFromOwned(self.ownedAccList)
self.curAccType = KartDNA.ebType
self.curAccIndex = {}
for type in self.unownedAccDict:
self.curAccIndex[type] = 0
self.kartView = KartViewer(list(base.localAvatar.getKartDNA()), 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, 0)], ['rotate_left_up',
'rotate_left_down',
'rotate_left_roll',
'rotate_left_down',
(-.24, 0)], (0, 0))
self.kartView.setBounds(-0.38, 0.38, 0.044, 0.58)
self.kartView.setBgColor(1.0, 1.0, 0.87, 1.0)
self.initialize = True
self.showAccessory()
model.removeNode()
return
def __handleBuyAccessory(self):
accessoryID = self.unownedAccDict[self.curAccType][self.curAccIndex[self.curAccType]]
self.ownedAccList.append(accessoryID)
self.unownedAccDict = getAccessoryDictFromOwned(self.ownedAccList)
self.__handleAccessoryChange(0)
messenger.send(self.doneEvent, [accessoryID])
def __handleAccessoryChange(self, nDir):
if len(self.unownedAccDict[self.curAccType]) < 1:
self.curAccIndex[self.curAccType] = -1
else:
self.curAccIndex[self.curAccType] = (self.curAccIndex[self.curAccType] + nDir) % len(self.unownedAccDict[self.curAccType])
if hasattr(self, 'accDescription'):
self.accDescription.destroy()
self.accCost.destroy()
self.showAccessory()
def __handleAccessoryTypeChange(self, type):
self.curAccType = type
try:
self.accDescription.destroy()
self.accCost.destroy()
except:
pass
for b in self.accButtonsDict: