本文整理汇总了Python中direct.gui.DirectGuiGlobals.setDefaultClickSound方法的典型用法代码示例。如果您正苦于以下问题:Python DirectGuiGlobals.setDefaultClickSound方法的具体用法?Python DirectGuiGlobals.setDefaultClickSound怎么用?Python DirectGuiGlobals.setDefaultClickSound使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类direct.gui.DirectGuiGlobals
的用法示例。
在下文中一共展示了DirectGuiGlobals.setDefaultClickSound方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadSfx
# 需要导入模块: from direct.gui import DirectGuiGlobals [as 别名]
# 或者: from direct.gui.DirectGuiGlobals import setDefaultClickSound [as 别名]
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
from pirates.piratesbase import UserFunnel
UserFunnel.logSubmit(1, 'CLIENT_OPENS')
示例2: ConfigVariableDouble
# 需要导入模块: from direct.gui import DirectGuiGlobals [as 别名]
# 或者: from direct.gui.DirectGuiGlobals import setDefaultClickSound [as 别名]
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'))
else:
示例3: ConfigVariableDouble
# 需要导入模块: from direct.gui import DirectGuiGlobals [as 别名]
# 或者: from direct.gui.DirectGuiGlobals import setDefaultClickSound [as 别名]
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])
base.accept("PandaRestarted", maybeDoSomethingWithMusic, [1])