本文整理汇总了Python中SCObject.SCObject.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python SCObject.__init__方法的具体用法?Python SCObject.__init__怎么用?Python SCObject.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SCObject.SCObject
的用法示例。
在下文中一共展示了SCObject.__init__方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from SCObject import SCObject [as 别名]
# 或者: from SCObject.SCObject import __init__ [as 别名]
def __init__(self, parentMenu = None):
SCObject.__init__(self)
self.SerialNum = SCElement.SerialNum
SCElement.SerialNum += 1
node = hidden.attachNewNode('SCElement%s' % self.SerialNum)
NodePath.__init__(self, node)
self.FinalizeTaskName = 'SCElement%s_Finalize' % self.SerialNum
self.parentMenu = parentMenu
self.__active = 0
self.__viewable = 1
self.lastWidth = 0
self.lastHeight = 0
self.setDimensions(0, 0)
self.padX = 0.25
self.padZ = 0.1
示例2: __init__
# 需要导入模块: from SCObject import SCObject [as 别名]
# 或者: from SCObject.SCObject import __init__ [as 别名]
def __init__(self, holder = None):
SCObject.__init__(self)
self.SerialNum = SCMenu.SerialNum
SCMenu.SerialNum += 1
node = hidden.attachNewNode('SCMenu%s' % self.SerialNum)
NodePath.__init__(self, node)
self.setHolder(holder)
self.FinalizeTaskName = 'SCMenu%s_Finalize' % self.SerialNum
self.ActiveMemberSwitchTaskName = 'SCMenu%s_SwitchActiveMember' % self.SerialNum
self.bg = loader.loadModel(self.BackgroundModelName)
def findNodes(names, model = self.bg):
results = []
for name in names:
for nm in makeTuple(name):
node = model.find('**/%s' % nm)
if not node.isEmpty():
results.append(node)
break
continue
return results
(self.bgTop, self.bgBottom, self.bgLeft, self.bgRight, self.bgMiddle, self.bgTopLeft, self.bgBottomLeft, self.bgTopRight, self.bgBottomRight) = findNodes([
('top', 'top1'),
'bottom',
'left',
'right',
'middle',
'topLeft',
'bottomLeft',
'topRight',
'bottomRight'])
self.bg.reparentTo(self, -1)
self._SCMenu__members = []
self.activeMember = None
self.activeCandidate = None
self.fadeIval = None
self.width = 1
self.inFinalize = 0