本文整理汇总了Java中com.badlogic.gdx.assets.loaders.TextureLoader.TextureParameter方法的典型用法代码示例。如果您正苦于以下问题:Java TextureLoader.TextureParameter方法的具体用法?Java TextureLoader.TextureParameter怎么用?Java TextureLoader.TextureParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.assets.loaders.TextureLoader
的用法示例。
在下文中一共展示了TextureLoader.TextureParameter方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDependencies
import com.badlogic.gdx.assets.loaders.TextureLoader; //导入方法依赖的package包/类
/** Retrieves TiledMap resource dependencies
*
* @param fileName
* @param parameter not used for now
* @return dependencies for the given .tmx file */
@Override
public Array<AssetDescriptor> getDependencies (String fileName, FileHandle tmxFile, Parameters parameter) {
Array<AssetDescriptor> dependencies = new Array<AssetDescriptor>();
try {
root = xml.parse(tmxFile);
boolean generateMipMaps = (parameter != null ? parameter.generateMipMaps : false);
TextureLoader.TextureParameter texParams = new TextureParameter();
texParams.genMipMaps = generateMipMaps;
if (parameter != null) {
texParams.minFilter = parameter.textureMinFilter;
texParams.magFilter = parameter.textureMagFilter;
}
for (FileHandle image : loadTilesets(root, tmxFile)) {
dependencies.add(new AssetDescriptor(image, Texture.class, texParams));
}
return dependencies;
} catch (IOException e) {
throw new GdxRuntimeException("Couldn't load tilemap '" + fileName + "'", e);
}
}
示例2: Assets
import com.badlogic.gdx.assets.loaders.TextureLoader; //导入方法依赖的package包/类
public Assets()
{
textureParameter = new TextureLoader.TextureParameter();
//textureParameter.genMipMaps = true;
textureParameter.magFilter = Texture.TextureFilter.Linear;
textureParameter.minFilter = Texture.TextureFilter.Linear;
resolver = new MaryoFileHandleResolver();
manager = new AssetManager(resolver);
particleEffectParameter = new ParticleEffectLoader.ParticleEffectParameter();
particleEffectParameter.imagesDir = resolver.resolve("data/animation/particles");
// set the loaders for the generator and the fonts themselves
manager.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(resolver));
manager.setLoader(BitmapFont.class, ".ttf", new FreetypeFontLoader(resolver));
manager.setLoader(ParticleEffect.class, ".p", new ParticleEffectLoader(resolver));
manager.setLoader(Sound.class, ".mp3", new SoundLoader(new InternalFileHandleResolver()));
manager.setLoader(Music.class, ".mp3", new MusicLoader(new InternalFileHandleResolver()));
}
示例3: getDependencies
import com.badlogic.gdx.assets.loaders.TextureLoader; //导入方法依赖的package包/类
@Override
public Array<AssetDescriptor> getDependencies(String fileName, FileHandle file, P parameters) {
final Array<AssetDescriptor> deps = new Array();
ModelData data = loadModelData(file, parameters);
if (data == null) return deps;
ObjectMap.Entry<String, ModelData> item = new ObjectMap.Entry<String, ModelData>();
item.key = fileName;
item.value = data;
synchronized (items) {
items.add(item);
}
TextureLoader.TextureParameter textureParameter = (parameters != null)
? parameters.textureParameter
: defaultParameters.textureParameter;
for (final ModelMaterial modelMaterial : data.materials) {
if (modelMaterial.textures != null) {
for (final ModelTexture modelTexture : modelMaterial.textures) {
String fName = modelTexture.fileName;
if (fName.contains("/")) {
fName = fName.substring(fName.lastIndexOf("/") + 1);
}
deps.add(new AssetDescriptor(currentAsset.dependenciesPath + fName, Texture.class, textureParameter));
}
}
}
return deps;
}
示例4: getDependencies
import com.badlogic.gdx.assets.loaders.TextureLoader; //导入方法依赖的package包/类
@Override
public Array<AssetDescriptor> getDependencies(String fileName, FileHandle file, TextureAtlasLoader.TextureAtlasParameter parameter) {
FileHandle imgDir = file.parent();
map = LyU.createDictionaryWithContentsOfFile(file);
ObjectMap<String, Object> metadata = (ObjectMap<String, Object>) map.get("metadata");
String dependFile = (String) metadata.get("textureFileName");
Array<AssetDescriptor> res = new Array<AssetDescriptor>();
TextureLoader.TextureParameter params = new TextureLoader.TextureParameter();
params.magFilter = Texture.TextureFilter.Linear;
params.minFilter = Texture.TextureFilter.Linear;
params.format = Pixmap.Format.RGBA8888;
texture = new Texture(imgDir.child(dependFile));
res.add(new AssetDescriptor(imgDir.child(dependFile), Texture.class, params));
return res;
}
示例5: GameScene
import com.badlogic.gdx.assets.loaders.TextureLoader; //导入方法依赖的package包/类
public GameScene(ModelLoader.ModelParameters modelParameters,
TextureLoader.TextureParameter textureParameter,
ParticleEffectLoader.ParticleEffectLoadParameter pfxParameter,
String pfxPath, String modelPath, String modelExt, ObjectMap<String, GameObjectBlueprint> sharedBlueprints) {
this.sharedBlueprints = sharedBlueprints;
this.assets = new BlenderAssetManager(modelParameters, textureParameter, pfxParameter,
pfxPath, modelPath, modelExt);
}
示例6: GameSceneManager
import com.badlogic.gdx.assets.loaders.TextureLoader; //导入方法依赖的package包/类
public GameSceneManager(ModelLoader.ModelParameters modelParameters,
TextureLoader.TextureParameter textureParameter,
ParticleEffectLoader.ParticleEffectLoadParameter pfxParameter,
String pfxPath, String modelPath, String modelExt) {
this.modelPath = modelPath;
this.modelExt = modelExt;
this.pfxPath = pfxPath;
this.modelParameters = modelParameters;
this.textureParameter = textureParameter;
this.pfxParameter = pfxParameter;
}
示例7: BlenderAssetManager
import com.badlogic.gdx.assets.loaders.TextureLoader; //导入方法依赖的package包/类
public BlenderAssetManager(
ModelLoader.ModelParameters modelParameters,
TextureLoader.TextureParameter textureParameter,
ParticleEffectLoader.ParticleEffectLoadParameter pfxParameter,
String pfxPath, String modelPath, String modelExt) {
this.modelExt = modelExt;
this.modelPath = modelPath;
this.pfxPath = pfxPath;
this.modelParameters = modelParameters;
this.textureParameter = textureParameter;
this.pfxParameter = pfxParameter;
}
示例8: getDependencies
import com.badlogic.gdx.assets.loaders.TextureLoader; //导入方法依赖的package包/类
@Override
public Array<AssetDescriptor> getDependencies(String fileName, FileHandle file,
AnimationExtendedParameter parameter) {
Array<AssetDescriptor> deps = new Array();
TextureLoader.TextureParameter params = new TextureParameter();
params.format = parameter.format;
params.genMipMaps = parameter.genMipMaps;
params.minFilter = parameter.minFilter;
params.magFilter = parameter.magFilter;
params.wrapU = parameter.wrapU;
params.wrapV = parameter.wrapV;
deps.add(new AssetDescriptor(parameter.filename, Texture.class, params));
return deps;
}
示例9: assetManager
import com.badlogic.gdx.assets.loaders.TextureLoader; //导入方法依赖的package包/类
public static MemoryTrackingAssetManager assetManager() {
if (assetManager == null) {
assetManager = new MemoryTrackingAssetManager(new FileResolverMultiplexer());
if (TowerConsts.DEBUG) {
assetManager.getLogger().setLevel(Logger.ERROR);
}
Texture.setAssetManager(assetManager);
try {
assetList = TowerGameService.instance().getObjectMapper().readValue(Gdx.files.internal("assets.json").read(), AssetList.class);
ensureAssetsAreLoaded();
} catch (IOException e) {
throw new RuntimeException(e);
}
TextureLoader.TextureParameter parameter = new TextureLoader.TextureParameter();
parameter.genMipMaps = true;
parameter.minFilter = MipMapNearestNearest;
parameter.magFilter = Linear;
assetManager.load(checkForHDPI("elevator/shaft.png"), Texture.class, parameter);
assetManager.load(checkForHDPI("elevator/empty.png"), Texture.class, parameter);
defaultSkin = new Skin(Gdx.files.internal("default-skin.json"));
makeCustomGUISkin();
}
return assetManager;
}
示例10: ModelParameters
import com.badlogic.gdx.assets.loaders.TextureLoader; //导入方法依赖的package包/类
public ModelParameters() {
textureParameter = new TextureLoader.TextureParameter();
textureParameter.minFilter = textureParameter.magFilter = Texture.TextureFilter.Linear;
textureParameter.wrapU = textureParameter.wrapV = Texture.TextureWrap.Repeat;
}
示例11: Material
import com.badlogic.gdx.assets.loaders.TextureLoader; //导入方法依赖的package包/类
public Material(ModelDesc.Material material)
{
_castShadows = material.castShadows;
_receiveShadows = material.receiveShadows;
_outline = material.outline;
TextureLoader.TextureParameter parameter = new TextureLoader.TextureParameter();
String filter = material.filter;
if (Utils.isEmpty(filter) || filter.equalsIgnoreCase("linear"))
{
parameter.minFilter = Texture.TextureFilter.Linear;
parameter.magFilter = Texture.TextureFilter.Linear;
}
else if (filter.equalsIgnoreCase("nearest"))
{
parameter.minFilter = Texture.TextureFilter.Nearest;
parameter.magFilter = Texture.TextureFilter.Nearest;
}
if (!Utils.isEmpty(material.diffuse))
{
Main.getAssetManager().load(Config.MODELS_DIR + material.diffuse, Texture.class, parameter);
}
if (!Utils.isEmpty(material.normal))
{
Main.getAssetManager().load(Config.MODELS_DIR + material.normal, Texture.class, parameter);
}
if (!Utils.isEmpty(material.specular))
{
Main.getAssetManager().load(Config.MODELS_DIR + material.specular, Texture.class, parameter);
}
Main.getAssetManager().finishLoading();
if (!Utils.isEmpty(material.diffuse))
{
_diffuse = Main.getAssetManager().get(Config.MODELS_DIR + material.diffuse, Texture.class);
}
if (!Utils.isEmpty(material.normal))
{
_normal = Main.getAssetManager().get(Config.MODELS_DIR + material.normal, Texture.class);
}
if (!Utils.isEmpty(material.specular))
{
_specular = Main.getAssetManager().get(Config.MODELS_DIR + material.specular, Texture.class);
}
}
示例12: HeadlessModelParameters
import com.badlogic.gdx.assets.loaders.TextureLoader; //导入方法依赖的package包/类
public HeadlessModelParameters() {
textureParameter = new TextureLoader.TextureParameter();
textureParameter.minFilter = textureParameter.magFilter = Texture.TextureFilter.Linear;
textureParameter.wrapU = textureParameter.wrapV = Texture.TextureWrap.Repeat;
}