本文整理汇总了Java中com.badlogic.gdx.graphics.glutils.FileTextureData类的典型用法代码示例。如果您正苦于以下问题:Java FileTextureData类的具体用法?Java FileTextureData怎么用?Java FileTextureData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FileTextureData类属于com.badlogic.gdx.graphics.glutils包,在下文中一共展示了FileTextureData类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: loadAsync
import com.badlogic.gdx.graphics.glutils.FileTextureData; //导入依赖的package包/类
@Override
public void loadAsync (AssetManager manager, String fileName, FileHandle fileHandle, TextureParameter parameter) {
if (parameter == null || (parameter != null && parameter.textureData == null)) {
Pixmap pixmap = null;
Format format = null;
boolean genMipMaps = false;
texture = null;
if (parameter != null) {
format = parameter.format;
genMipMaps = parameter.genMipMaps;
texture = parameter.texture;
}
FileHandle handle = resolve(fileName);
pixmap = new Pixmap(handle);
data = new FileTextureData(handle, pixmap, format, genMipMaps);
} else {
data = parameter.textureData;
if (!data.isPrepared()) data.prepare();
texture = parameter.texture;
}
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:24,代码来源:TextureLoader.java
示例2: getAtlas
import com.badlogic.gdx.graphics.glutils.FileTextureData; //导入依赖的package包/类
public static TextureAtlas getAtlas(String path) {
if(textureAtlasMap.containsKey(path)) {
return textureAtlasMap.get(path);
} else {
TextureAtlas textureAtlas = new TextureAtlas(Gdx.files.internal("data/images/" + path));
textureAtlasMap.put(path.substring(path.lastIndexOf("/") + 1, path.length()), textureAtlas);
for(Texture texture : textureAtlas.getTextures()) {
String name = "" + texture;
if(texture.getTextureData() instanceof FileTextureData)
name = ((FileTextureData)texture.getTextureData()).getFileHandle().name();
textureMap.put(name, texture);
textureDataMap.put(texture, texture.getTextureData());
}
return textureAtlas;
}
}
开发者ID:devalexx,项目名称:evilrain,代码行数:19,代码来源:TextureManager.java
示例3: c
import com.badlogic.gdx.graphics.glutils.FileTextureData; //导入依赖的package包/类
private static TextureData c(String paramString, boolean paramBoolean)
{
String str;
if (paramBoolean)
str = "-useMipMaps";
try
{
aj.a("AssetUtils.getTextureData", str);
FileTextureData localFileTextureData = new FileTextureData((FileHandle)an.a(a(paramString)), null, null, paramBoolean);
return localFileTextureData;
str = "";
}
finally
{
aj.b();
}
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:18,代码来源:c.java
示例4: ensurePot
import com.badlogic.gdx.graphics.glutils.FileTextureData; //导入依赖的package包/类
protected Pixmap ensurePot(Pixmap pixmap) {
if (Gdx.gl20 == null && FileTextureData.copyToPOT) {
int pixmapWidth = pixmap.getWidth();
int pixmapHeight = pixmap.getHeight();
int potWidth = MathUtils.nextPowerOfTwo(pixmapWidth);
int potHeight = MathUtils.nextPowerOfTwo(pixmapHeight);
if (pixmapWidth != potWidth || pixmapHeight != potHeight) {
Pixmap copy = PixmapUtil.resizedCopy(pixmap, Dim.of(potWidth, potHeight), Filter.BiLinear);
pixmap.dispose();
return copy;
}
}
return pixmap;
}
开发者ID:anonl,项目名称:nvlist,代码行数:15,代码来源:PremultFileTextureData.java
示例5: fromSpriteComponent
import com.badlogic.gdx.graphics.glutils.FileTextureData; //导入依赖的package包/类
void fromSpriteComponent(SpriteComponent component){
layer = component.layer;
for (ObjectMap.Entry<String,Sprite> entry : component.spriteMap.entries()){
FileTextureData data = (FileTextureData) entry.value.getTexture().getTextureData();
spriteMap.put(entry.key,data.getFileHandle().name());
}
}
开发者ID:Deftwun,项目名称:ZombieCopter,代码行数:8,代码来源:SpriteComponent.java
示例6: loadFromFile
import com.badlogic.gdx.graphics.glutils.FileTextureData; //导入依赖的package包/类
public static TextureData loadFromFile (FileHandle file, Format format, boolean useMipMaps) {
if (file == null) return null;
if (file.name().endsWith(".cim")) return new FileTextureData(file, PixmapIO.readCIM(file), format, useMipMaps);
if (file.name().endsWith(".etc1")) return new ETC1TextureData(file, useMipMaps);
if (file.name().endsWith(".ktx") || file.name().endsWith(".zktx")) return new KTXTextureData(file, useMipMaps);
return new FileTextureData(file, new Pixmap(file), format, useMipMaps);
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:8,代码来源:TextureData.java
示例7: setAtlas
import com.badlogic.gdx.graphics.glutils.FileTextureData; //导入依赖的package包/类
public void setAtlas(TextureAtlas atlas){
if(atlas == this.atlas) return;
regionsPanel.removeAll();
Array<AtlasRegion> atlasRegions = atlas.getRegions();
CustomCardLayout layout = (CustomCardLayout)regionsPanel.getLayout();
Array<TextureRegion> regions = new Array<TextureRegion>();
for(Texture texture : atlas.getTextures()){
FileTextureData file = (FileTextureData)texture.getTextureData();
regionsPanel.add(new TexturePanel( texture, getRegions(texture, atlasRegions, regions)));
}
layout.first(regionsPanel);
this.atlas = atlas;
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:14,代码来源:TextureAtlasPanel.java
示例8: addExistingAtlas
import com.badlogic.gdx.graphics.glutils.FileTextureData; //导入依赖的package包/类
public static void addExistingAtlas(String path, TextureAtlas textureAtlas) {
textureAtlasMap.put(path, textureAtlas);
for(Texture texture : textureAtlas.getTextures()) {
String name = "" + texture;
if(texture.getTextureData() instanceof FileTextureData)
name = ((FileTextureData)texture.getTextureData()).getFileHandle().name();
textureMap.put(name, texture);
textureDataMap.put(texture, texture.getTextureData());
}
}
开发者ID:devalexx,项目名称:evilrain,代码行数:12,代码来源:TextureManager.java
示例9: Texture
import com.badlogic.gdx.graphics.glutils.FileTextureData; //导入依赖的package包/类
public Texture(FileHandle paramFileHandle, Pixmap.Format paramFormat, boolean paramBoolean)
{
if (paramFileHandle.name().contains(".etc1"))
{
create(new ETC1TextureData(paramFileHandle, paramBoolean));
return;
}
create(new FileTextureData(paramFileHandle, null, paramFormat, paramBoolean));
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:10,代码来源:Texture.java
示例10: loadAsync
import com.badlogic.gdx.graphics.glutils.FileTextureData; //导入依赖的package包/类
public void loadAsync(AssetManager paramAssetManager, String paramString, TextureLoader.TextureParameter paramTextureParameter)
{
if ((paramTextureParameter == null) || ((paramTextureParameter != null) && (paramTextureParameter.textureData == null)))
{
this.texture = null;
boolean bool = false;
Pixmap.Format localFormat = null;
if (paramTextureParameter != null)
{
localFormat = paramTextureParameter.format;
bool = paramTextureParameter.genMipMaps;
this.texture = paramTextureParameter.texture;
}
FileHandle localFileHandle = resolve(paramString);
if (!paramString.contains(".etc1"))
{
if (paramString.contains(".cim"));
for (Pixmap localPixmap = PixmapIO.readCIM(localFileHandle); ; localPixmap = new Pixmap(localFileHandle))
{
this.data = new FileTextureData(localFileHandle, localPixmap, localFormat, bool);
return;
}
}
this.data = new ETC1TextureData(localFileHandle, bool);
return;
}
this.data = paramTextureParameter.textureData;
if (!this.data.isPrepared())
this.data.prepare();
this.texture = paramTextureParameter.texture;
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:32,代码来源:TextureLoader.java
示例11: create
import com.badlogic.gdx.graphics.glutils.FileTextureData; //导入依赖的package包/类
public void create() {
int width = 800;
int height = 600;
Tilo.width = width;
Tilo.height = height;
script = new lua();
// LOAD PLUGINS
g.plugin_load();
script.put("graphics", g);
script.put("timer", t);
script.put("window", w);
script.put("math", m);
script.put("input", i);
script.put("audio", a);
if (getPlatform().equalsIgnoreCase("desktop")) {
width = 800;
height = 600;
Tilo.width = width;
Tilo.height = height;
boolean fullscreen = false;
Gdx.graphics.setDisplayMode(width, height, fullscreen);
}
assets = new AssetManager();
Gdx.input.setInputProcessor(this);
// LOAD SCRIPT
FileHandle main = file("main.lua");
if (main.exists()) {
script.eval(main.readString());
} else {
error(TAG, E_RESOURCE + main.name());
quit();
}
// Enable non power of two textures.
FileTextureData.copyToPOT = true;
// Set OpenGL features
Gdx.gl.glDisable(GL20.GL_CULL_FACE);
Gdx.gl.glDisable(GL20.GL_DITHER);
Gdx.gl.glDisable(GL20.GL_DEPTH_TEST);
Gdx.gl.glEnable(GL20.GL_SCISSOR_TEST);
script.invoke("tilo", "load", assets);
ready = true;
}
开发者ID:Murii,项目名称:Tilo-game-framework,代码行数:53,代码来源:Tilo.java
示例12: loadFromFile
import com.badlogic.gdx.graphics.glutils.FileTextureData; //导入依赖的package包/类
public static TextureData loadFromFile(FileHandle file, Format format, boolean useMipMaps) {
if (file == null) {
return null;
}
return new FileTextureData(file, new Pixmap(file), format, useMipMaps);
}
开发者ID:konsoletyper,项目名称:teavm-libgdx,代码行数:7,代码来源:TextureDataEmulator.java
示例13: loadFromFile
import com.badlogic.gdx.graphics.glutils.FileTextureData; //导入依赖的package包/类
public static TextureData loadFromFile (FileHandle file, Format format, boolean useMipMaps) {
if (file == null) return null;
return new FileTextureData(file, new Pixmap(file), format, useMipMaps);
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:5,代码来源:TextureData.java
示例14: setTexture
import com.badlogic.gdx.graphics.glutils.FileTextureData; //导入依赖的package包/类
public void setTexture(Texture texture){
if(this.texture == texture) return;
this.texture = texture;
FileTextureData data = (FileTextureData)texture.getTextureData();
setImage(data.getFileHandle().file().getAbsolutePath());
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:7,代码来源:TexturePanel.java
示例15: create
import com.badlogic.gdx.graphics.glutils.FileTextureData; //导入依赖的package包/类
public void create () {
spriteBatch = new SpriteBatch();
// texture = new Texture(new PixmapTextureData(new Pixmap(Gdx.files.internal("data/t8890.png")), null, false, true));
texture = new Texture(new FileTextureData(Gdx.files.internal("data/t8890.png"), null, null, false));
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:6,代码来源:TextureDataTest.java
示例16: b
import com.badlogic.gdx.graphics.glutils.FileTextureData; //导入依赖的package包/类
private static Texture b(TextureData paramTextureData)
{
int i = 0;
Object localObject1 = null;
Texture localTexture;
while (true)
{
Object localObject2;
int k;
try
{
localTexture = new Texture(paramTextureData);
int j = i;
localObject2 = localObject1;
k = j;
if (localObject2 == null)
break;
boolean bool = paramTextureData instanceof FileTextureData;
FileHandle localFileHandle = null;
if (bool)
localFileHandle = ((FileTextureData)paramTextureData).getFileHandle();
aa localaa = a;
Object[] arrayOfObject = new Object[4];
arrayOfObject[0] = localFileHandle;
arrayOfObject[1] = Integer.valueOf(k);
arrayOfObject[2] = Texture.getManagedStatus();
arrayOfObject[3] = localTexture;
localaa.c(localObject2, "Exception in create texture. file(%s) try(%d) status(%s) texture(%s)", arrayOfObject);
if (localTexture != null)
break;
throw localObject2;
}
catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException1)
{
i++;
}
if (i >= 2)
{
ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException2 = localArrayIndexOutOfBoundsException1;
k = i;
localObject2 = localArrayIndexOutOfBoundsException2;
localTexture = null;
}
}
return localTexture;
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:47,代码来源:c.java
注:本文中的com.badlogic.gdx.graphics.glutils.FileTextureData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论