• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TextureAtlasLoader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.badlogic.gdx.assets.loaders.TextureAtlasLoader的典型用法代码示例。如果您正苦于以下问题:Java TextureAtlasLoader类的具体用法?Java TextureAtlasLoader怎么用?Java TextureAtlasLoader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TextureAtlasLoader类属于com.badlogic.gdx.assets.loaders包,在下文中一共展示了TextureAtlasLoader类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: AssetManager

import com.badlogic.gdx.assets.loaders.TextureAtlasLoader; //导入依赖的package包/类
/** Creates a new AssetManager with all default loaders. */
public AssetManager (FileHandleResolver resolver) {
	setLoader(BitmapFont.class, new BitmapFontLoader(resolver));
	setLoader(Music.class, new MusicLoader(resolver));
	setLoader(Pixmap.class, new PixmapLoader(resolver));
	setLoader(Sound.class, new SoundLoader(resolver));
	setLoader(TextureAtlas.class, new TextureAtlasLoader(resolver));
	setLoader(Texture.class, new TextureLoader(resolver));
	setLoader(Skin.class, new SkinLoader(resolver));
	setLoader(ParticleEffect.class, new ParticleEffectLoader(resolver));
	setLoader(PolygonRegion.class, new PolygonRegionLoader(resolver));
	setLoader(I18NBundle.class, new I18NBundleLoader(resolver));
	setLoader(Model.class, ".g3dj", new G3dModelLoader(new JsonReader(), resolver));
	setLoader(Model.class, ".g3db", new G3dModelLoader(new UBJsonReader(), resolver));
	setLoader(Model.class, ".obj", new ObjLoader(resolver));
	executor = new AsyncExecutor(1);
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:18,代码来源:AssetManager.java


示例2: getDependencies

import com.badlogic.gdx.assets.loaders.TextureAtlasLoader; //导入依赖的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


示例3: EngineAssetManager

import com.badlogic.gdx.assets.loaders.TextureAtlasLoader; //导入依赖的package包/类
protected EngineAssetManager(FileHandleResolver resolver) {
	super(resolver);

	resResolver = new EngineResolutionFileResolver(resolver);
	setLoader(Texture.class, new TextureLoader(resResolver));
	setLoader(TextureAtlas.class, new TextureAtlasLoader(resResolver));
	setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(resolver));
	setLoader(BitmapFont.class, ".ttf", new FreetypeFontLoader(resolver));

	Texture.setAssetManager(this);
}
 
开发者ID:bladecoder,项目名称:bladecoder-adventure-engine,代码行数:12,代码来源:EngineAssetManager.java


示例4: load

import com.badlogic.gdx.assets.loaders.TextureAtlasLoader; //导入依赖的package包/类
@Override
public TextureAtlas load(AssetManager assetManager, String fileName, FileHandle file, TextureAtlasLoader.TextureAtlasParameter parameter) {
    TextureAtlas atlas = new TextureAtlas();
    atlas.getTextures().add(texture);
    ObjectMap<String, Object> frames = (ObjectMap<String, Object>) map.get("frames");
    for (ObjectMap.Entry<String, Object> entry : frames.entries()) {
        String pageName = entry.key;
        ObjectMap<String, Object> params = (ObjectMap<String, Object>) entry.value;
        Rectangle frame = LyU.parseRect((String) params.get("frame"));
        GridPoint2 offset = LyU.parsePoint((String) params.get("offset"));
        boolean rotated = Boolean.parseBoolean((String) params.get("rotated"));
        GridPoint2 sourceSize = LyU.parsePoint((String) params.get("sourceSize"));
        Rectangle sourceColorRect = LyU.parseRect((String) params.get("sourceColorRect"));
        TextureAtlas.TextureAtlasData.Region region = new TextureAtlas.TextureAtlasData.Region();
        region.name = pageName.substring(0, pageName.lastIndexOf('.'));
        region.rotate = rotated;
        region.offsetX = offset.x;
        region.offsetY = offset.y;
        region.originalWidth = sourceSize.x;
        region.originalHeight = sourceSize.y;
        region.left = (int) frame.x;
        region.top = (int) frame.y;
        region.width = (int) frame.getWidth();
        region.height = (int) frame.getHeight();
        int width = region.width;
        int height = region.height;
        TextureAtlas.AtlasRegion atlasRegion = new TextureAtlas.AtlasRegion(texture, region.left, region.top,
            region.rotate ? height : width, region.rotate ? width : height);
        atlasRegion.index = region.index;
        atlasRegion.name = region.name;
        atlasRegion.offsetX = region.offsetX;
        atlasRegion.offsetY = region.offsetY;
        atlasRegion.originalHeight = region.originalHeight;
        atlasRegion.originalWidth = region.originalWidth;
        atlasRegion.rotate = region.rotate;
        atlasRegion.splits = region.splits;
        atlasRegion.pads = region.pads;
        if (region.flip) {
            atlasRegion.flip(false, true);
        }
        atlas.getRegions().add(atlasRegion);
    }
    texture = null;
    map = null;
    return atlas;
}
 
开发者ID:varFamily,项目名称:cocos-ui-libgdx,代码行数:47,代码来源:CCTextureAtlasLoader.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GroupObject类代码示例发布时间:2022-05-23
下一篇:
Java Text类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap