当前位置: 首页>>代码示例>>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;未经允许,请勿转载。