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


Java InternalFileHandleResolver類代碼示例

本文整理匯總了Java中com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver的典型用法代碼示例。如果您正苦於以下問題:Java InternalFileHandleResolver類的具體用法?Java InternalFileHandleResolver怎麽用?Java InternalFileHandleResolver使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


InternalFileHandleResolver類屬於com.badlogic.gdx.assets.loaders.resolvers包,在下文中一共展示了InternalFileHandleResolver類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initialise

import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver; //導入依賴的package包/類
@Override
public void initialise() {
	FallbackFileHandleResolver fallbackFileHandleResolver = new FallbackFileHandleResolver(
			new ClasspathFileHandleResolver(), new InternalFileHandleResolver());
	assetManager = new AssetManager(fallbackFileHandleResolver);
	assetManager.setLogger(new Logger("AssetManager", Application.LOG_ERROR));

	assetManager.setLoader(UiTheme.class, new UiThemeLoader(fallbackFileHandleResolver));
	assetManager.setLoader(TiledMap.class, new TiledMapLoader(fallbackFileHandleResolver));

	addScreen(new LoadingScreen(assetManager));
	addScreen(new UATSelectionScreen(assetManager));
	addScreen(new BlendingUAT());
	addScreen(new ClippingUAT());
	addScreen(new GeometryUAT());
	addScreen(new GraphicsUAT(assetManager));
	addScreen(new TextureRegionUAT());
	addScreen(new OrthogonalTiledMapNoCachingUAT(assetManager));
	addScreen(new OrthogonalTiledMapWithCachingUAT(assetManager));
	addScreen(new IsometricTiledMapUAT(assetManager));
	addScreen(new HexagonalTiledMapUAT(assetManager));
	addScreen(new ParticleEffectsUAT());
	addScreen(new ControllerUAT());
	addScreen(new ControllerMapping());
	addScreen(new UiUAT(assetManager));
}
 
開發者ID:mini2Dx,項目名稱:mini2Dx,代碼行數:27,代碼來源:UATApplication.java

示例2: loadAssets

import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver; //導入依賴的package包/類
private void loadAssets() {
    InternalFileHandleResolver fileHandler = new InternalFileHandleResolver();
    assetManager = new AssetManager(fileHandler);
    assetManager.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(fileHandler));

    assetManager.load(SKIN_PATH, Skin.class);
    assetManager.load(MASTER_PATH, TextureAtlas.class);
    assetManager.load(FONT_NORMAL_PATH, FreeTypeFontGenerator.class);
    assetManager.load(FONT_BOLD_PATH, FreeTypeFontGenerator.class);
    assetManager.load(MUSIC_PATH, Music.class);
    assetManager.load(MAIN_MENU_MUSIC_PATH, Music.class);
    assetManager.load(GOOD_PATH, Sound.class);
    assetManager.load(HALF_PATH, Sound.class);
    assetManager.load(BAD_PATH, Sound.class);
    assetManager.finishLoading();
}
 
開發者ID:DurianHLN,項目名稱:Polymorph,代碼行數:17,代碼來源:Polymorph.java

示例3: Font

import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver; //導入依賴的package包/類
public Font(final Application APP, String fileName, String filePath, int size, boolean filter)
{
    // ASSIGN ATTRIBUTES
    this.size = size;

    FreetypeFontLoader.FreeTypeFontLoaderParameter parameter = new FreetypeFontLoader.FreeTypeFontLoaderParameter();
    FileHandleResolver resolver = new InternalFileHandleResolver();

    APP.assets.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(resolver));
    APP.assets.setLoader(BitmapFont.class, ".otf", new FreetypeFontLoader(resolver));

    // GENERATE FONT
    if (filter) // IF FILTER ENABLED
    {
        parameter.fontParameters.genMipMaps = true;
        parameter.fontParameters.minFilter = Texture.TextureFilter.Linear;
        parameter.fontParameters.magFilter = Texture.TextureFilter.Linear;
    }
    parameter.fontFileName = filePath;
    parameter.fontParameters.size = size;

    APP.assets.load(fileName, BitmapFont.class, parameter);
    APP.assets.finishLoading();

    font = APP.assets.get(fileName, BitmapFont.class);
}
 
開發者ID:NahroTo,項目名稱:Fruit-Destroyer,代碼行數:27,代碼來源:Font.java

示例4: newResolver

import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver; //導入依賴的package包/類
@Override
public FileHandleResolver newResolver (FileType fileType) {
	switch (fileType) {
	case Absolute:
		return new AbsoluteFileHandleResolver();
	case Classpath:
		return new ClasspathFileHandleResolver();
	case External:
		return new ExternalFileHandleResolver();
	case Internal:
		return new InternalFileHandleResolver();
	case Local:
		return new LocalFileHandleResolver();
	}
	return null; // Should never happen
}
 
開發者ID:Mignet,項目名稱:Inspiration,代碼行數:17,代碼來源:GdxFileSystem.java

示例5: show

import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver; //導入依賴的package包/類
@Override
public void show() {
    super.show();
    layout = new GlyphLayout();
    font = new NativeFont(new NativeFontPaint(25));
    font.appendText("正在加載...0123456789%");
    font.setColor(Color.BLACK);
    layout.setText(font, "正在加載...100%");

    stage = new Stage(new StretchViewport(1280, 720));

    assetManager = new AssetManager();
    assetManager.setLogger(new Logger("log", Logger.DEBUG));
    assetManager.setLoader(CocosScene.class, new CocosLoader(new InternalFileHandleResolver()));
    assetManager.load("mainscene/MenuScene.json", CocosScene.class);
}
 
開發者ID:varFamily,項目名稱:cocos-ui-libgdx,代碼行數:17,代碼來源:AMScreen.java

示例6: Moon

import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver; //導入依賴的package包/類
public Moon(final AssetManager manager) {
    manager.setLoader(Texture.class, new TextureLoader(new InternalFileHandleResolver()));
    manager.setLoader(Sound.class, new SoundLoader(new InternalFileHandleResolver()));
    manager.load(TEXTURE_FILENAME, Texture.class);
    manager.load(SFX_MOON_CRASH_FILENAME, Sound.class);
    manager.finishLoading();

    texture = manager.get(TEXTURE_FILENAME);
    crashSfx = manager.get(SFX_MOON_CRASH_FILENAME);

    currentFrame = new TextureRegion(texture);

    setWidth(currentFrame.getRegionWidth());
    setHeight(currentFrame.getRegionHeight());
    setOrigin(getWidth() / 2, getHeight() / 2);

    reset(); 
}
 
開發者ID:broken-shotgun,項目名稱:throw-the-moon,代碼行數:19,代碼來源:Moon.java

示例7: Background

import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver; //導入依賴的package包/類
public Background(AssetManager manager) {
    manager.setLoader(Texture.class, new TextureLoader(new InternalFileHandleResolver()));
    manager.load(TEXTURE_FILENAME, Texture.class);
    manager.finishLoading();

    texture = manager.get(TEXTURE_FILENAME);
    
    TextureRegion[] frames = TextureRegion.split(texture, FRAME_WIDTH, FRAME_HEIGHT)[0];
    animation = new Animation(0.1f, frames[0], frames[1], frames[2]);
    animation.setPlayMode(PlayMode.LOOP);
    
    setWidth(FRAME_WIDTH);
    setHeight(FRAME_HEIGHT);
    
    background = new TiledDrawable(animation.getKeyFrame(0f));
}
 
開發者ID:broken-shotgun,項目名稱:throw-the-moon,代碼行數:17,代碼來源:Background.java

示例8: MoonChain

import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver; //導入依賴的package包/類
public MoonChain(final AssetManager manager) {
    manager.setLoader(Texture.class, new TextureLoader(new InternalFileHandleResolver()));
    manager.setLoader(Sound.class, new SoundLoader(new InternalFileHandleResolver()));
    manager.load(TEXTURE_FILENAME, Texture.class);
    manager.load(SFX_CHAIN_PULL_FILENAME, Sound.class);
    manager.finishLoading();

    texture = manager.get(TEXTURE_FILENAME);
    texture.setWrap(Texture.TextureWrap.ClampToEdge, Texture.TextureWrap.Repeat);
    
    chainPullSfx = manager.get(SFX_CHAIN_PULL_FILENAME);

    setWidth(texture.getWidth());
    setHeight(texture.getHeight() * TILE_COUNT);
    setOrigin(getWidth() / 2, 0);
    
    // Note: scale is not used in draw for the chain, this is a hack to make easier to put the chain down
    setScale(3f, 3f);

    collisionArea = new Rectangle(getX(), getY(), getWidth(), getHeight());
    position = new Vector2(getX(), getY());
}
 
開發者ID:broken-shotgun,項目名稱:throw-the-moon,代碼行數:23,代碼來源:MoonChain.java

示例9: Enemy

import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver; //導入依賴的package包/類
public Enemy(final AssetManager manager) {
    manager.setLoader(Texture.class, new TextureLoader(new InternalFileHandleResolver()));
    manager.setLoader(Sound.class, new SoundLoader(new InternalFileHandleResolver()));
    manager.load(TEXTURE_FILENAME, Texture.class);
    manager.load(SFX_HIT_FILENAME, Sound.class);
    manager.finishLoading();

    texture = manager.get(TEXTURE_FILENAME);
    regions = TextureRegion.split(texture, FRAME_WIDTH, FRAME_HEIGHT)[0];
    idle = new Animation(0.1f, regions[0], regions[1], regions[2]);
    idle.setPlayMode(Animation.PlayMode.LOOP);

    hitSfx = manager.get(SFX_HIT_FILENAME);

    currentFrame = idle.getKeyFrame(0.0f);

    setWidth(currentFrame.getRegionWidth());
    setHeight(currentFrame.getRegionHeight());
    setOrigin(getWidth() / 2, getHeight() / 2);

    collisionArea = new Rectangle(50, 0, (int)getWidth() - 100, (int)getHeight());

    health = 5;
}
 
開發者ID:broken-shotgun,項目名稱:throw-the-moon,代碼行數:25,代碼來源:Enemy.java

示例10: FlameMain

import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver; //導入依賴的package包/類
public FlameMain () {
	super("Flame");
	MathUtils.random = new RandomXS128();
	particleSystem = ParticleSystem.get();
	effect = new ParticleEffect();
	particleSystem.add(effect);
	assetManager = new AssetManager();
	assetManager.setErrorListener(this);
	assetManager.setLoader(ParticleEffect.class, new ParticleEffectLoader(new InternalFileHandleResolver()));
	controllersData = new Array<ControllerData>();
	
	lwjglCanvas = new LwjglCanvas(renderer = new AppRenderer());
	addWindowListener(new WindowAdapter() {
		public void windowClosed (WindowEvent event) {
			//System.exit(0);
			Gdx.app.exit();
		}
	});

	initializeComponents();

	setSize(1280, 950);
	setLocationRelativeTo(null);
	setDefaultCloseOperation(DISPOSE_ON_CLOSE);
	setVisible(true);
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:27,代碼來源:FlameMain.java

示例11: create

import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver; //導入依賴的package包/類
@Override
public void create () {
	float w = Gdx.graphics.getWidth();
	float h = Gdx.graphics.getHeight();

	camera = new OrthographicCamera();
	camera.setToOrtho(false, (w / h) * 10, 10);
	camera.zoom = 2;
	camera.update();

	cameraController = new OrthoCamController(camera);
	Gdx.input.setInputProcessor(cameraController);

	font = new BitmapFont();
	batch = new SpriteBatch();

	assetManager = new AssetManager();
	assetManager.setLoader(TiledMap.class, new TmxMapLoader(new InternalFileHandleResolver()));
	assetManager.load("data/maps/tiled/isometric_grass_and_water.tmx", TiledMap.class);
	assetManager.finishLoading();
	map = assetManager.get("data/maps/tiled/isometric_grass_and_water.tmx");
	renderer = new IsometricTiledMapRenderer(map, 1f / 64f);
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:24,代碼來源:TiledMapAssetManagerTest.java

示例12: create

import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver; //導入依賴的package包/類
@Override
public void create () {
	float w = Gdx.graphics.getWidth();
	float h = Gdx.graphics.getHeight();

	camera = new OrthographicCamera();
	camera.setToOrtho(false, (w / h) * 10, 10);
	camera.zoom = 2;
	camera.update();

	cameraController = new OrthoCamController(camera);
	Gdx.input.setInputProcessor(cameraController);

	font = new BitmapFont();
	batch = new SpriteBatch();

	assetManager = new AssetManager();
	assetManager.setLoader(TiledMap.class, new TideMapLoader(new InternalFileHandleResolver()));
	assetManager.load("data/maps/tide/Map01.tide", TiledMap.class);
	assetManager.finishLoading();
	map = assetManager.get("data/maps/tide/Map01.tide");
	renderer = new OrthogonalTiledMapRenderer(map, 1f / 32f);
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:24,代碼來源:TideMapAssetManagerTest.java

示例13: Assets

import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver; //導入依賴的package包/類
public Assets(SoundService soundService,
        GraphicsService graphicsService,
        LocaleService localeService,
        TaflLevelService levelService,
        TaflGame game) {
    super(soundService, graphicsService, localeService, levelService, game);

    this.soundService = soundService;
    this.graphicsService = graphicsService;
    this.localeService = localeService;
    this.levelService = levelService;
    this.game = game;

    assetManager.setLoader(com.badlogic.gdx.scenes.scene2d.ui.Skin.class,
            new CustomSkinLoader(new InternalFileHandleResolver()));

    if (Constants.GameConstants.DEBUG) {
        assetManager.getLogger().setLevel(Logger.DEBUG);
    }
}
 
開發者ID:apotapov,項目名稱:tafl,代碼行數:21,代碼來源:Assets.java

示例14: loadNonBlocking

import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver; //導入依賴的package包/類
private static boolean loadNonBlocking(){
	if(!readinglock){
		clear();
		loadAssets();
		readinglock = true;
	}
	// once update returns true then condition is satisfied and the lock stops update call
	if(!updatinglock)
		if(assetMan.update()){
			assetMan.setLoader(TiledMap.class, new TmxMapLoader(new InternalFileHandleResolver()));
			getAssets();
			updatinglock = true;
			if(Scene.splashDuration != 0)
				Scene.nextSceneWithDelay(Scene.splashDuration);
			else
				Scene.nextScene();
		}
	return updatinglock;
}
 
開發者ID:pyros2097,項目名稱:GdxStudio,代碼行數:20,代碼來源:Asset.java

示例15: load

import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver; //導入依賴的package包/類
public void load(AssetManager assetManager) {
	background.load(assetManager);
	fish1.load(assetManager);
	fish2.load(assetManager);
	fish3.load(assetManager);
	fish4.load(assetManager);
	fish5.load(assetManager);
	fish6.load(assetManager);
	fish7.load(assetManager);
	fish8.load(assetManager);
	fish9.load(assetManager);
	fish10.load(assetManager);
	assetManager.load(AppConst.EXIT_BUTTON_TEXTURE, Texture.class);
	assetManager.load(AppConst.ADD_FISH_BUTTON_TEXTURE, Texture.class);
	assetManager.load(AppConst.SELECT_FISH_BUTTONS_TEXTURE, Texture.class);
	assetManager.load(AppConst.SELECT_TRAJECTORY_TEXTURE, Texture.class);
	FileHandleResolver resolver = new InternalFileHandleResolver();
	assetManager.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(resolver));
	assetManager.setLoader(BitmapFont.class, ".ttf", new FreetypeFontLoader(resolver));
	FreeTypeFontLoaderParameter size1Params = new FreeTypeFontLoaderParameter();
	size1Params.fontFileName = AppConst.DEFAUFT_FONT;
	size1Params.fontParameters.size =  AppConst.KEY_FONT_SIZE;
	assetManager.load(AppConst.KEY_FONT_NAME, BitmapFont.class, size1Params);
}
 
開發者ID:phat-trien-phan-mem-phan-tan,項目名稱:dynamicpool,代碼行數:25,代碼來源:AssetGameScreen.java


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