本文整理汇总了Java中com.badlogic.gdx.Audio类的典型用法代码示例。如果您正苦于以下问题:Java Audio类的具体用法?Java Audio怎么用?Java Audio使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Audio类属于com.badlogic.gdx包,在下文中一共展示了Audio类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: load
import com.badlogic.gdx.Audio; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static <T> T load(Class<T> type, String filepath,
Object... parameters) {
T output = null;
setAssetClass(type);
try {
if (gameAsset == null)
gameAsset = new DefaultGameAsset();
if (type == Texture.class) {
if (parameters.length == 0)
output = (T) gameAsset.loadTexture(filepath);
else if (parameters.length == 1) {
output = (T) gameAsset.loadTexture(filepath,
(Format) parameters[0], true);
} else if (parameters.length == 2) {
output = (T) gameAsset.loadTexture(filepath,
(Format) parameters[0], (Boolean) parameters[1]);
} else {
throw new GdxRuntimeException("Parameters is not valid!");
}
} else if (type == BitmapFont.class) {
if (parameters.length == 0)
output = (T) gameAsset.loadBitmapFont(filepath);
else if (parameters.length == 1) {
output = (T) gameAsset.loadBitmapFont(filepath,
(String) parameters[0]);
} else {
throw new GdxRuntimeException("Parameters is not valid!");
}
} else if (type == TextureRegion.class) {
if (parameters.length == 0)
output = (T) gameAsset.loadTextureRegion(filepath);
else if (parameters.length == 1) {
output = (T) gameAsset.loadTextureRegion(filepath,
(Rectangle) parameters[0]);
} else if (parameters.length == 2) {
output = (T) gameAsset.loadTextureRegion(
(Texture) parameters[0], (Rectangle) parameters[1]);
} else {
throw new GdxRuntimeException("Parameters is not valid!");
}
} else if (type == Music.class) {
if (parameters.length == 0)
output = (T) gameAsset.loadMusic(filepath);
else if (parameters.length == 1) {
output = (T) gameAsset.loadMusic(filepath,
(Float) parameters[0]);
} else {
throw new GdxRuntimeException("Parameters is not valid!");
}
} else if (type == Audio.class) {
if (parameters.length == 0)
output = (T) gameAsset.loadSound(filepath);
} else if (type == ShaderProgram.class) {
if (parameters.length == 0)
output = (T) gameAsset.loadShader(filepath);
else if (parameters.length == 1) {
output = (T) gameAsset.loadShader(filepath,
(String) parameters[0]);
} else {
throw new GdxRuntimeException("Parameters is not valid!");
}
} else if (type == StillModel.class) {
if (parameters.length == 0)
output = (T) gameAsset.loadModel(filepath);
}
} catch (Exception ex) {
throw new GdxRuntimeException("Invalid parameters you passed");
}
return output;
}
示例2: getAudio
import com.badlogic.gdx.Audio; //导入依赖的package包/类
@Override
public Audio getAudio () {
return audio;
}
示例3: getAudio
import com.badlogic.gdx.Audio; //导入依赖的package包/类
@Override
public Audio getAudio() {
return audio;
}
示例4: getAudio
import com.badlogic.gdx.Audio; //导入依赖的package包/类
@Override
public Audio getAudio() {
return Gdx.audio;
}
示例5: getAudio
import com.badlogic.gdx.Audio; //导入依赖的package包/类
public Audio getAudio () {
return null;
}
示例6: getAudio
import com.badlogic.gdx.Audio; //导入依赖的package包/类
@Override
public Audio getAudio () {
return Gdx.audio;
}
示例7: getAudio
import com.badlogic.gdx.Audio; //导入依赖的package包/类
@Override
public Audio getAudio() {
return audio;
}
示例8: getAudio
import com.badlogic.gdx.Audio; //导入依赖的package包/类
@Override
public Audio getAudio () {
return audio;
}
示例9: getAudio
import com.badlogic.gdx.Audio; //导入依赖的package包/类
@Override
public Audio getAudio () {
return Gdx.audio;
}
示例10: getAudio
import com.badlogic.gdx.Audio; //导入依赖的package包/类
@Override
public Audio getAudio() {
return Gdx.audio;
}
示例11: getAudio
import com.badlogic.gdx.Audio; //导入依赖的package包/类
public Audio getAudio()
{
return this.audio;
}