本文整理汇总了Java中com.badlogic.gdx.graphics.g2d.PolygonRegionLoader类的典型用法代码示例。如果您正苦于以下问题:Java PolygonRegionLoader类的具体用法?Java PolygonRegionLoader怎么用?Java PolygonRegionLoader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PolygonRegionLoader类属于com.badlogic.gdx.graphics.g2d包,在下文中一共展示了PolygonRegionLoader类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AssetManager
import com.badlogic.gdx.graphics.g2d.PolygonRegionLoader; //导入依赖的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);
}
示例2: create
import com.badlogic.gdx.graphics.g2d.PolygonRegionLoader; //导入依赖的package包/类
@Override
public void create () {
texture = new Texture(Gdx.files.internal("data/tree.png"));
PolygonRegionLoader loader = new PolygonRegionLoader();
region = loader.load(new TextureRegion(texture), Gdx.files.internal("data/tree.psh"));
// create a region from an arbitrary set of vertices (a triangle in this case)
region2 = new PolygonRegion(new TextureRegion(texture), new float[] {0, 0, 100, 100, 0, 100}, new short[] {0, 1, 2});
camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
camera.position.x = 0;
camera.position.y = 0;
batch = new PolygonSpriteBatch();
debugRenderer = new PolygonRegionDebugRenderer();
Gdx.input.setInputProcessor(this);
}
示例3: create
import com.badlogic.gdx.graphics.g2d.PolygonRegionLoader; //导入依赖的package包/类
@Override
public void create () {
texture = new Texture(Gdx.files.internal("data/tree.png"));
PolygonRegionLoader loader = new PolygonRegionLoader();
region = loader.load(new TextureRegion(texture), Gdx.files.internal("data/tree.psh"));
renderer = new ShapeRenderer();
camera = new OrthographicCamera(480, 320);
camera.position.x = 240;
camera.position.y = 160;
camera.update();
batch = new PolygonSpriteBatch();
for (int i = 0; i < 50; i++) {
PolygonSprite sprite = new PolygonSprite(region);
sprite.setPosition(MathUtils.random(-30, 440), MathUtils.random(-30, 290));
sprite.setColor(MathUtils.random(), MathUtils.random(), MathUtils.random(), 1.0f);
sprite.setScale(MathUtils.random(0.5f, 1.5f), MathUtils.random(0.5f, 1.5f));
sprites.add(sprite);
}
}