當前位置: 首頁>>代碼示例>>Java>>正文


Java PolygonRegionLoader類代碼示例

本文整理匯總了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);
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:18,代碼來源:AssetManager.java

示例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);
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:20,代碼來源:PolygonRegionTest.java

示例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);
	}
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:25,代碼來源:PolygonSpriteTest.java


注:本文中的com.badlogic.gdx.graphics.g2d.PolygonRegionLoader類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。