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


Python DirectGuiGlobals.setDefaultRolloverSound方法代码示例

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


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

示例1: loadSfx

# 需要导入模块: from direct.gui import DirectGuiGlobals [as 别名]
# 或者: from direct.gui.DirectGuiGlobals import setDefaultRolloverSound [as 别名]
from direct.showbase.ShowBaseGlobal import *
if base.config.GetBool('want-preloader', 0):
    base.preloader = PiratesPreloader.PiratesPreloader()

if base.win == None:
    print 'Unable to open window; aborting.'
    sys.exit()

launcher.setPandaErrorCode(0)
launcher.setPandaWindowOpen()
base.sfxPlayer.setCutoffDistance(500.0)
from pirates.audio import SoundGlobals
from pirates.audio.SoundGlobals import loadSfx
rolloverSound = loadSfx(SoundGlobals.SFX_GUI_ROLLOVER_01)
rolloverSound.setVolume(0.5)
DirectGuiGlobals.setDefaultRolloverSound(rolloverSound)
clickSound = loadSfx(SoundGlobals.SFX_GUI_CLICK_01)
DirectGuiGlobals.setDefaultClickSound(clickSound)
clearColor = Vec4(0.0, 0.0, 0.0, 1.0)
base.win.setClearColor(clearColor)
from pirates.shader.Hdr import *
hdr = Hdr()
from pirates.seapatch.Reflection import Reflection
Reflection.initialize(render)
serverVersion = base.config.GetString('server-version', 'no_version_set')
print 'serverVersion:', serverVersion
from pirates.distributed import PiratesClientRepository
cr = PiratesClientRepository.PiratesClientRepository(serverVersion, launcher)
base.initNametagGlobals()
base.startShow(cr)
from otp.distributed import OtpDoGlobals
开发者ID:Puggyblue999,项目名称:PiratesOfTheCarribeanOnline,代码行数:33,代码来源:PiratesStart.py

示例2: ConfigVariableDouble

# 需要导入模块: from direct.gui import DirectGuiGlobals [as 别名]
# 或者: from direct.gui.DirectGuiGlobals import setDefaultRolloverSound [as 别名]
ConfigVariableDouble('decompressor-step-time').setValue(0.01)
ConfigVariableDouble('extractor-step-time').setValue(0.01)
backgroundNodePath = aspect2d.attachNewNode(backgroundNode, 0)
backgroundNodePath.setPos(0.0, 0.0, 0.0)
backgroundNodePath.setScale(render2d, VBase3(1))
backgroundNodePath.find('**/fg').hide()
logo = OnscreenImage(
    image='phase_3/maps/toontown-logo.png',
    scale=(1 / (4.0/3.0), 1, 1 / (4.0/3.0)),
    pos=backgroundNodePath.find('**/fg').getPos())
logo.setTransparency(TransparencyAttrib.MAlpha)
logo.setBin('fixed', 20)
logo.reparentTo(backgroundNodePath)
backgroundNodePath.find('**/bg').setBin('fixed', 10)
base.graphicsEngine.renderFrame()
DirectGuiGlobals.setDefaultRolloverSound(base.loadSfx('phase_3/audio/sfx/GUI_rollover.ogg'))
DirectGuiGlobals.setDefaultClickSound(base.loadSfx('phase_3/audio/sfx/GUI_create_toon_fwd.ogg'))
DirectGuiGlobals.setDefaultDialogGeom(loader.loadModel('phase_3/models/gui/dialog_box_gui'))
import TTLocalizer
from otp.otpbase import OTPGlobals
OTPGlobals.setDefaultProductPrefix(TTLocalizer.ProductPrefix)
if base.musicManagerIsValid:
    themeList = ('phase_3/audio/bgm/ttp_theme.ogg', 'phase_3/audio/bgm/ttp_theme_2.ogg')
    music = base.loadMusic(random.choice(themeList))
    if music:
        music.setLoop(1)
        music.setVolume(0.9)
        music.play()
    notify.info('Loading the default Toontown Planet GUI sounds...')
    DirectGuiGlobals.setDefaultRolloverSound(base.loadSfx('phase_3/audio/sfx/GUI_rollover.ogg'))
    DirectGuiGlobals.setDefaultClickSound(base.loadSfx('phase_3/audio/sfx/GUI_create_toon_fwd.ogg'))
开发者ID:Teku16,项目名称:ToontownPlanet,代码行数:33,代码来源:ToontownPlanetStart.py

示例3: ConfigVariableDouble

# 需要导入模块: from direct.gui import DirectGuiGlobals [as 别名]
# 或者: from direct.gui.DirectGuiGlobals import setDefaultRolloverSound [as 别名]
base.setFrameRateMeter(False)
base.accept("f9", base.screenshot, ["screenshots/screenshot"])
from direct.filter.CommonFilters import CommonFilters

print "CIStart: Setting display preferences..."
sm.applySettings(jsonfile)
if base.win == None:
    print "CIStart: Unable to open window; aborting."
    sys.exit()
else:
    print "CIStart: Successfully opened window."
ConfigVariableDouble("decompressor-step-time").setValue(0.01)
ConfigVariableDouble("extractor-step-time").setValue(0.01)
DirectGuiGlobals.setDefaultFontFunc(CIGlobals.getToonFont)
DirectGuiGlobals.setDefaultFont(CIGlobals.getToonFont())
DirectGuiGlobals.setDefaultRolloverSound(loader.loadSfx("phase_3/audio/sfx/GUI_rollover.mp3"))
DirectGuiGlobals.setDefaultClickSound(loader.loadSfx("phase_3/audio/sfx/GUI_create_toon_fwd.mp3"))
DirectGuiGlobals.setDefaultDialogGeom(loader.loadModel("phase_3/models/gui/dialog_box_gui.bam"))


def maybeDoSomethingWithMusic(condition):
    width, height, fs, music, sfx, tex_detail, model_detail, aa, af = sm.getSettings(jsonfile)
    if condition == 0:
        if music == True:
            base.enableMusic(False)
    elif condition == 1:
        if music == True:
            base.enableMusic(True)


base.accept("PandaPaused", maybeDoSomethingWithMusic, [0])
开发者ID:coginvasion,项目名称:src,代码行数:33,代码来源:CIStart.py


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