本文整理汇总了Python中score.Score.insertMovie方法的典型用法代码示例。如果您正苦于以下问题:Python Score.insertMovie方法的具体用法?Python Score.insertMovie怎么用?Python Score.insertMovie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类score.Score
的用法示例。
在下文中一共展示了Score.insertMovie方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MenuManager
# 需要导入模块: from score import Score [as 别名]
# 或者: from score.Score import insertMovie [as 别名]
#.........这里部分代码省略.........
def getHtml(self, name):
return self.getResource(self.resolveDocUrl(name))
def getImage(self, name):
imageName = self.info[name]['image']
category = self.info[name]['category']
fileName = self.info[name]['filename']
if self.info[name]['qml'] == 'true':
fileName = 'qml-' + fileName.split('/')[-1]
if not imageName:
if category == 'demos':
imageName = fileName + '-demo.png'
else:
imageName = fileName + '-example.png'
if self.getResource(self.resolveImageUrl(imageName)).isEmpty():
imageName = fileName + '.png'
if self.getResource(self.resolveImageUrl(imageName)).isEmpty():
imageName = fileName + 'example.png'
return self.getResource(self.resolveImageUrl(imageName))
def createRootMenu(self, el):
name = str(el.attribute('name'))
self.createMenu(el, MenuManager.MENU1)
self.createInfo(
MenuContentItem(el, self.window.scene,
self.window.mainSceneRoot),
name + ' -info')
menuButtonsIn = self.score.insertMovie(name + ' -buttons')
menuButtonsOut = self.score.insertMovie(name + ' -buttons -out')
self.createLowLeftButton("Quit", MenuManager.QUIT, menuButtonsIn,
menuButtonsOut, None)
self.createLowRightButton("Toggle fullscreen", MenuManager.FULLSCREEN,
menuButtonsIn, menuButtonsOut, None)
def createSubMenu(self, el):
name = str(el.attribute('name'))
self.createMenu(el, MenuManager.MENU2)
self.createInfo(
MenuContentItem(el, self.window.scene,
self.window.mainSceneRoot),
name + ' -info')
def createLeafMenu(self, el):
name = str(el.attribute('name'))
self.createInfo(
ExampleContent(name, self.window.scene,
self.window.mainSceneRoot),
name)
infoButtonsIn = self.score.insertMovie(name + ' -buttons')
infoButtonsOut = self.score.insertMovie(name + ' -buttons -out')
self.createLowRightLeafButton("Documentation", 600,
MenuManager.DOCUMENTATION, infoButtonsIn, infoButtonsOut, None)
if str(el.attribute('executable')) != 'false':
self.createLowRightLeafButton("Launch", 405, MenuManager.LAUNCH,
infoButtonsIn, infoButtonsOut, None)
elif str(el.attribute('qml')) == 'true':
self.createLowRightLeafButton("Display", 405,
MenuManager.LAUNCH_QML, infoButtonsIn, infoButtonsOut,
None)
示例2: MenuManager
# 需要导入模块: from score import Score [as 别名]
# 或者: from score.Score import insertMovie [as 别名]
#.........这里部分代码省略.........
return self.helpRootUrl + dirName.replace('/', '-') + '-' + fileName + '.html'
def resolveImageUrl(self, name):
return self.helpRootUrl + 'images/' + name
def getHtml(self, name):
return self.getResource(self.resolveDocUrl(name))
def getImage(self, name):
imageName = self.info[name]['image']
fileName = self.info[name]['filename']
if self.info[name]['qml'] == 'true':
fileName = 'qml-' + fileName.split('/')[-1]
if not imageName:
imageName = fileName + '-example.png'
if self.getResource(self.resolveImageUrl(imageName)).isEmpty():
imageName = fileName + '.png'
if self.getResource(self.resolveImageUrl(imageName)).isEmpty():
imageName = fileName + 'example.png'
return self.getResource(self.resolveImageUrl(imageName))
def createRootMenu(self, el):
name = el.getAttribute('name')
self.createMenu(el, MenuManager.MENU1)
self.createInfo(
MenuContentItem(el, self.window.mainSceneRoot),
name + ' -info')
menuButtonsIn = self.score.insertMovie(name + ' -buttons')
menuButtonsOut = self.score.insertMovie(name + ' -buttons -out')
self.createLowLeftButton("Quit", MenuManager.QUIT, menuButtonsIn,
menuButtonsOut, None)
self.createLowRightButton("Toggle fullscreen", MenuManager.FULLSCREEN,
menuButtonsIn, menuButtonsOut, None)
def createSubMenu(self, el):
name = el.getAttribute('name')
self.createMenu(el, MenuManager.MENU2)
self.createInfo(
MenuContentItem(el, self.window.mainSceneRoot),
name + ' -info')
def createLeafMenu(self, el):
name = el.getAttribute('name')
self.createInfo(ExampleContent(name, self.window.mainSceneRoot), name)
infoButtonsIn = self.score.insertMovie(name + ' -buttons')
infoButtonsOut = self.score.insertMovie(name + ' -buttons -out')
self.createLowRightLeafButton("Documentation", 600,
MenuManager.DOCUMENTATION, infoButtonsIn, infoButtonsOut, None)
if el.getAttribute('executable') != 'false':
self.createLowRightLeafButton("Launch", 405, MenuManager.LAUNCH,
infoButtonsIn, infoButtonsOut, None)
elif el.getAttribute('qml') == 'true':
self.createLowRightLeafButton("Display", 405,
MenuManager.LAUNCH_QML, infoButtonsIn, infoButtonsOut,
None)
def createMenu(self, category, type):
sw = self.window.scene.sceneRect().width()
xOffset = 15