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


Java TextureLoader.TextureParameter方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:26,代码来源:TmxMapLoader.java

示例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()));
}
 
开发者ID:pedja1,项目名称:SMC-Android,代码行数:21,代码来源:Assets.java

示例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;
}
 
开发者ID:MovementSpeed,项目名称:nhglib,代码行数:35,代码来源:NhgModelLoader.java

示例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;
}
 
开发者ID:varFamily,项目名称:cocos-ui-libgdx,代码行数:16,代码来源:CCTextureAtlasLoader.java

示例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);
}
 
开发者ID:jsjolund,项目名称:GdxDemo3D,代码行数:9,代码来源:GameScene.java

示例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;
}
 
开发者ID:jsjolund,项目名称:GdxDemo3D,代码行数:13,代码来源:GameSceneManager.java

示例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;
}
 
开发者ID:jsjolund,项目名称:GdxDemo3D,代码行数:14,代码来源:BlenderAssetManager.java

示例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;
}
 
开发者ID:GameDevWeek,项目名称:CodeBase,代码行数:15,代码来源:AnimationExtendedLoader.java

示例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;
}
 
开发者ID:frigidplanet,项目名称:droidtowers,代码行数:31,代码来源:TowerAssetManager.java

示例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;
}
 
开发者ID:MovementSpeed,项目名称:nhglib,代码行数:6,代码来源:NhgModelLoader.java

示例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);
	}
}
 
开发者ID:arksu,项目名称:origin,代码行数:51,代码来源:Material.java

示例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;
}
 
开发者ID:jrenner,项目名称:gdx-proto,代码行数:6,代码来源:HeadlessModelLoader.java


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