本文整理汇总了Java中com.badlogic.gdx.assets.loaders.TextureLoader.TextureParameter类的典型用法代码示例。如果您正苦于以下问题:Java TextureParameter类的具体用法?Java TextureParameter怎么用?Java TextureParameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextureParameter类属于com.badlogic.gdx.assets.loaders.TextureLoader包,在下文中一共展示了TextureParameter类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadAsync
import com.badlogic.gdx.assets.loaders.TextureLoader.TextureParameter; //导入依赖的package包/类
@Override
public void loadAsync(AssetManager manager, String fileName, FileHandle file,
TextureParameter parameter) {
if (parameter == null || parameter.textureData == null) {
Format format = null;
boolean genMipMaps = false;
info.texture = null;
if (parameter != null) {
format = parameter.format;
genMipMaps = parameter.genMipMaps;
info.texture = parameter.texture;
}
info.data = loadTexData(file, format, genMipMaps);
} else {
info.data = parameter.textureData;
info.texture = parameter.texture;
}
if (!info.data.isPrepared()) {
info.data.prepare();
}
}
示例2: loadSync
import com.badlogic.gdx.assets.loaders.TextureLoader.TextureParameter; //导入依赖的package包/类
@Nullable
@Override
public Texture loadSync(AssetManager manager, String fileName, FileHandle file,
TextureParameter parameter) {
if (info == null) {
return null;
}
Texture texture = info.texture;
if (texture != null) {
texture.load(info.data);
} else {
texture = new Texture(info.data);
}
if (parameter == null) {
GdxTextureUtil.setDefaultTextureParams(texture);
} else {
texture.setFilter(parameter.minFilter, parameter.magFilter);
texture.setWrap(parameter.wrapU, parameter.wrapV);
}
return texture;
}
示例3: getLoadParams
import com.badlogic.gdx.assets.loaders.TextureLoader.TextureParameter; //导入依赖的package包/类
@Override
@Nullable
protected AssetLoaderParameters<Texture> getLoadParams(FilePath imagePath) {
IImageDefinition imageDef = getImageDef(imagePath);
if (imageDef == null) {
return null;
}
TextureParameter params = new TextureParameter();
params.minFilter = GdxTextureUtil.toGdxFilter(imageDef.getMinifyFilter());
params.magFilter = GdxTextureUtil.toGdxFilter(imageDef.getMagnifyFilter());
params.wrapU = GdxTextureUtil.toGdxWrap(imageDef.getTilingModeX());
params.wrapV = GdxTextureUtil.toGdxWrap(imageDef.getTilingModeY());
return params;
}
示例4: getDependencies
import com.badlogic.gdx.assets.loaders.TextureLoader.TextureParameter; //导入依赖的package包/类
@Override
public Array<AssetDescriptor> getDependencies(String fileName, FileHandle fileHandle, TiledMapParameter parameter) {
try {
map = new TiledMap(fileName, parameter.polyMode);
} catch (Exception e) {
logger.error("Failed loading tiled map", e);
return null;
}
Array<AssetDescriptor> deps = new Array();
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;
IResourceLocator locator = CurrentResourceLocator.get();
for (TileSet tileset : map.getTileSets()) {
TmxImage img = tileset.getImage();
String path = locator.combinePaths(tileset.getFilename(), img.getSource());
deps.add(new AssetDescriptor(path, Texture.class, params));
}
return deps;
}
示例5: getDependencies
import com.badlogic.gdx.assets.loaders.TextureLoader.TextureParameter; //导入依赖的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);
}
}
示例6: loadSync
import com.badlogic.gdx.assets.loaders.TextureLoader.TextureParameter; //导入依赖的package包/类
@Override
public Texture loadSync(AssetManager manager, String fileName,
FileHandle file, TextureParameter parameter) {
if (file instanceof URLFileHandle
&& parameter instanceof URLTextureParameter
&& ((URLTextureParameter) parameter).writePixmapTo != null) {
if (pixmap != null) {
Texture texture = new Texture(pixmap);
pixmap.dispose();
pixmap = null;
return texture;
} else {
return textureLoader.loadSync(manager, fileName,
((URLTextureParameter) parameter).writePixmapTo,
parameter);
}
} else {
return textureLoader.loadSync(manager, fileName, file, parameter);
}
}
示例7: getDependencies
import com.badlogic.gdx.assets.loaders.TextureLoader.TextureParameter; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Nullable
@Override
public Array<AssetDescriptor> getDependencies(String fileName, FileHandle file,
TextureParameter parameter) {
return null;
}
示例8: loadAssetLists
import com.badlogic.gdx.assets.loaders.TextureLoader.TextureParameter; //导入依赖的package包/类
private void loadAssetLists() {
TextureParameter param = new TextureParameter();
param.minFilter = param.magFilter = Texture.TextureFilter.Linear;
assetManager.loadAssetList("data/json/images.json", Texture.class, param);
assetManager.loadAssetList("data/json/sounds.json", Sound.class, null);
assetManager.loadAssetList("data/json/music.json", Music.class, null);
assetManager.loadAssetListWithParam("data/json/animations.json", AnimationExtended.class,
AnimationExtendedLoader.AnimationExtendedParameter.class);
BitmapFontParameter fontParam = new BitmapFontParameter();
fontParam.flip = true;
assetManager.loadAssetList("data/json/fonts.json", BitmapFont.class, fontParam);
}
示例9: getDependencies
import com.badlogic.gdx.assets.loaders.TextureLoader.TextureParameter; //导入依赖的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;
}
示例10: TitleScreen
import com.badlogic.gdx.assets.loaders.TextureLoader.TextureParameter; //导入依赖的package包/类
public TitleScreen(Sokobug myGame) {
game = myGame;
readyToSkip = false;
TextureParameter param = new TextureParameter();
param.minFilter = TextureFilter.Linear;
param.magFilter = TextureFilter.Linear;
game.assetManager.load(Resources.BACKGROUNDS_TITLE.getPath(), Texture.class, param);
game.assetManager.finishLoading();
titleImage = new Sprite(game.assetManager.get(Resources.BACKGROUNDS_TITLE.getPath(), Texture.class));
titleImage.setPosition(0.f, 0.f);
pasedTimeCounter = 0.0f;
titleScreenMinDuration = 3.5f;
game.assetManager.load(Resources.FONTS_JAPONESA24.getPath(), BitmapFont.class);
game.assetManager.load(Resources.FONTS_JAPONESA32.getPath(), BitmapFont.class);
game.assetManager.load(Resources.FONTS_JAPONESA60.getPath(), BitmapFont.class);
game.assetManager.load(Resources.FONTS_JAPONESA120.getPath(), BitmapFont.class);
game.assetManager.load(Resources.UI_BUTTONS_PACK.getPath(), TextureAtlas.class);
game.assetManager.load(Resources.UI_BUTTONS_JSON.getPath(), Skin.class, new SkinLoader.SkinParameter(
Resources.UI_BUTTONS_PACK.getPath()));
game.assetManager.load(Resources.BACKGROUNDS_MENU.getPath(), Texture.class, param);
game.assetManager.load(Resources.BACKGROUNDS_POTATOES.getPath(), Texture.class, param);
game.assetManager.load(Resources.ANIMATIONS_PACK_BUG.getPath(), TextureAtlas.class);
game.assetManager.load(Resources.ANIMATIONS_PACK_SPOTGLOW.getPath(), TextureAtlas.class);
game.assetManager.load(Resources.ANIMATIONS_PACK_VICTORYGLOW.getPath(), TextureAtlas.class);
game.assetManager.load(Resources.TILES_SARCOPHAGUS.getPath(), Texture.class, param);
game.assetManager.load(Resources.TILES_WALL.getPath(), Texture.class, param);
game.assetManager.load(Resources.TILES_FREE.getPath(), Texture.class, param);
game.assetManager.load(Resources.TILES_SPOTON.getPath(), Texture.class, param);
game.assetManager.load(Resources.TILES_SPOTOFF.getPath(), Texture.class, param);
game.assetManager.load(Resources.METAITEMS_TOPBAR.getPath(), Texture.class, param);
game.assetManager.load(Resources.METAITEMS_PAD.getPath(), Texture.class, param);
game.assetManager.load(Resources.METAITEMS_VICTORYWING.getPath(), Texture.class, param);
game.assetManager.load(Resources.LABELS_FINISH.getPath(), Texture.class, param);
game.assetManager.load(Resources.SOUND_BUGMOVE.getPath(), Sound.class);
game.assetManager.load(Resources.SOUND_BUTTONCLICK.getPath(), Sound.class);
game.assetManager.load(Resources.SOUND_SARCOPHAGUSMOVE.getPath(), Sound.class);
game.assetManager.load(Resources.SOUND_VICTORY.getPath(), Sound.class);
}
示例11: getDependencies
import com.badlogic.gdx.assets.loaders.TextureLoader.TextureParameter; //导入依赖的package包/类
@Override
public Array<AssetDescriptor> getDependencies(String fileName,
FileHandle file, TextureParameter parameter) {
return null;
}