当前位置: 首页>>代码示例>>Java>>正文


Java FileHandleResolver类代码示例

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


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

示例1: Font

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

示例2: newResolver

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

示例3: loadState

import com.badlogic.gdx.assets.loaders.FileHandleResolver; //导入依赖的package包/类
/** Loads the specified scene as the current Scene
 * 
 * @param sceneString - the Scene to load */
public void loadState (final String sceneString) {
	String scenePath = getAssetManager().getAssetFileName(RavTech.currentScene);
	RavTech.currentScene.dispose();
	getAssetManager().unload(scenePath);
	getAssetManager().setLoader(Scene.class, new SceneLoader(new FileHandleResolver() {
		@Override
		public FileHandle resolve (String fileName) {
			return new FileHandle() {
				@Override
				public String readString () {
					return sceneString;
				}
			};
		}
	}));
	loadAsset(scenePath, Scene.class);
	finishLoading();
	RavTech.currentScene = getAsset(scenePath, Scene.class);
	getAssetManager().setLoader(Scene.class, new SceneLoader(getResolver()));
}
 
开发者ID:Quexten,项目名称:RavTech,代码行数:24,代码来源:RavFiles.java

示例4: AssetManager

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

示例5: load

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

示例6: prepareAssets

import com.badlogic.gdx.assets.loaders.FileHandleResolver; //导入依赖的package包/类
@Override
public void prepareAssets(UiTheme theme, FileHandleResolver fileHandleResolver, AssetManager assetManager) {
	if (theme.isHeadless()) {
		return; 
	}
	super.prepareAssets(theme, fileHandleResolver, assetManager);
	
	if(sliderBar != null) {
		sliderBarNinePatch = new NinePatch(new TextureRegion(theme.getTextureAtlas().findRegion(sliderBar)), sliderBarNinePatchLeft,
				sliderBarNinePatchRight, sliderBarNinePatchTop, sliderBarNinePatchBottom);
	}
	normalTextureRegion = new TextureRegion(theme.getTextureAtlas().findRegion(normal));
	activeTextureRegion = new TextureRegion(theme.getTextureAtlas().findRegion(active));
	hoverTextureRegion = new TextureRegion(theme.getTextureAtlas().findRegion(hover));
	disabledTextureRegion = new TextureRegion(theme.getTextureAtlas().findRegion(disabled));
}
 
开发者ID:mini2Dx,项目名称:mini2Dx,代码行数:17,代码来源:SliderStyleRule.java

示例7: prepareAssets

import com.badlogic.gdx.assets.loaders.FileHandleResolver; //导入依赖的package包/类
@Override
public void prepareAssets(UiTheme theme, FileHandleResolver fileHandleResolver, AssetManager assetManager) {
	if (theme.isHeadless()) {
		return; 
	}
	
	if(background != null) {
		if(getBackgroundMode().equalsIgnoreCase(BG_REPEAT_MODE)) {
			backgroundNinePatch = new RepeatedNinePatch(new TextureRegion(theme.getTextureAtlas().findRegion(background)), getNinePatchLeft(),
					getNinePatchRight(), getNinePatchTop(), getNinePatchBottom());
		} else {
			backgroundNinePatch = new NinePatch(new TextureRegion(theme.getTextureAtlas().findRegion(background)), getNinePatchLeft(),
					getNinePatchRight(), getNinePatchTop(), getNinePatchBottom());
		}
	}
}
 
开发者ID:mini2Dx,项目名称:mini2Dx,代码行数:17,代码来源:ParentStyleRule.java

示例8: prepareAssets

import com.badlogic.gdx.assets.loaders.FileHandleResolver; //导入依赖的package包/类
@Override
public void prepareAssets(UiTheme theme, FileHandleResolver fileHandleResolver, AssetManager assetManager) {
	if (theme.isHeadless()) {
		return; 
	}
	
	normalNinePatch = new NinePatch(new TextureRegion(theme.getTextureAtlas().findRegion(normal)), getPaddingLeft(),
			getPaddingRight(), getPaddingTop(), getPaddingBottom());
	hoverNinePatch = new NinePatch(new TextureRegion(theme.getTextureAtlas().findRegion(hover)), getPaddingLeft(),
			getPaddingRight(), getPaddingTop(), getPaddingBottom());
	actionNinePatch = new NinePatch(new TextureRegion(theme.getTextureAtlas().findRegion(action)), getPaddingLeft(),
			getPaddingRight(), getPaddingTop(), getPaddingBottom());
	disabledNinePatch = new NinePatch(new TextureRegion(theme.getTextureAtlas().findRegion(disabled)), getPaddingLeft(),
			getPaddingRight(), getPaddingTop(), getPaddingBottom());
	color = ColorUtils.rgbToColor(textColor);
	
	UiFont themeFont = theme.getFont(font);
	FreeTypeFontParameter fontParameter = new  FreeTypeFontParameter();
	fontParameter.size = fontSize;
	fontParameter.flip = true;
	if(themeFont.getBorderWidth() > 0) {
		fontParameter.borderWidth = themeFont.getBorderWidth();
		fontParameter.borderColor = themeFont.getFontBorderColor();
	}
	bitmapFont = themeFont.generateFont(fontParameter);
}
 
开发者ID:mini2Dx,项目名称:mini2Dx,代码行数:27,代码来源:TextBoxStyleRule.java

示例9: prepareAssets

import com.badlogic.gdx.assets.loaders.FileHandleResolver; //导入依赖的package包/类
@Override
public void prepareAssets(UiTheme theme, FileHandleResolver fileHandleResolver, AssetManager assetManager) {
	if (theme.isHeadless()) {
		return; 
	}
	
	super.prepareAssets(theme, fileHandleResolver, assetManager);
	if(textColor != null) {
		color = ColorUtils.rgbToColor(textColor);
	}
	
	UiFont themeFont = theme.getFont(font);
	FreeTypeFontParameter fontParameter = new  FreeTypeFontParameter();
	fontParameter.size = fontSize;
	fontParameter.flip = true;
	if(themeFont.getBorderWidth() > 0) {
		fontParameter.borderWidth = themeFont.getBorderWidth();
		fontParameter.borderColor = themeFont.getFontBorderColor();
	}
	bitmapFont = themeFont.generateFont(fontParameter);
}
 
开发者ID:mini2Dx,项目名称:mini2Dx,代码行数:22,代码来源:LabelStyleRule.java

示例10: prepareAssets

import com.badlogic.gdx.assets.loaders.FileHandleResolver; //导入依赖的package包/类
@Override
public void prepareAssets(UiTheme theme, FileHandleResolver fileHandleResolver, AssetManager assetManager) {
	if (theme.isHeadless()) {
		return; 
	}
	
	super.prepareAssets(theme, fileHandleResolver, assetManager);
	scrollTrackNinePatch = new NinePatch(new TextureRegion(theme.getTextureAtlas().findRegion(scrollTrack)), scrollTrackNinePatchLeft,
			scrollTrackNinePatchRight, scrollTrackNinePatchTop, scrollTrackNinePatchBottom);
	
	scrollThumbNormalNinePatch = new NinePatch(new TextureRegion(theme.getTextureAtlas().findRegion(scrollThumbNormal)), scrollThumbNinePatchLeft,
			scrollThumbNinePatchRight, scrollThumbNinePatchTop, scrollThumbNinePatchBottom);
	scrollThumbHoverNinePatch = new NinePatch(new TextureRegion(theme.getTextureAtlas().findRegion(scrollThumbHover)), scrollThumbNinePatchLeft,
			scrollThumbNinePatchRight, scrollThumbNinePatchTop, scrollThumbNinePatchBottom);
	scrollThumbActiveNinePatch = new NinePatch(new TextureRegion(theme.getTextureAtlas().findRegion(scrollThumbAction)), scrollThumbNinePatchLeft,
			scrollThumbNinePatchRight, scrollThumbNinePatchTop, scrollThumbNinePatchBottom);
}
 
开发者ID:mini2Dx,项目名称:mini2Dx,代码行数:18,代码来源:ScrollBoxStyleRule.java

示例11: init

import com.badlogic.gdx.assets.loaders.FileHandleResolver; //导入依赖的package包/类
public void init(Nhg nhg) {
    this.nhg = nhg;
    fsm = new DefaultStateMachine<>(this, AssetsStates.IDLE);

    assetManager = new AssetManager();
    syncAssetManager = new AssetManager();

    FileHandleResolver resolver = assetManager.getFileHandleResolver();
    FileHandleResolver syncResolver = syncAssetManager.getFileHandleResolver();

    assetManager.setLoader(Scene.class, new SceneLoader(nhg, resolver));
    assetManager.setLoader(InputProxy.class, new InputLoader(resolver));
    assetManager.setLoader(JsonValue.class, new JsonLoader(resolver));
    assetManager.setLoader(HDRData2.class, new HDRLoader(resolver));
    assetManager.setLoader(Model.class, ".g3db", new NhgG3dModelLoader(this,
            new UBJsonReader(), resolver));

    syncAssetManager.setLoader(Scene.class, new SceneLoader(nhg, syncResolver));
    syncAssetManager.setLoader(InputProxy.class, new InputLoader(syncResolver));
    syncAssetManager.setLoader(JsonValue.class, new JsonLoader(syncResolver));
    syncAssetManager.setLoader(HDRData2.class, new HDRLoader(syncResolver));
    syncAssetManager.setLoader(Model.class, ".g3db", new NhgG3dModelLoader(this,
            new UBJsonReader(), syncResolver));

    assetManager.setErrorListener(this);
    syncAssetManager.setErrorListener(this);

    assetQueue = new Array<>();
    assetCache = new ArrayMap<>();

    Texture.setAssetManager(assetManager);
}
 
开发者ID:MovementSpeed,项目名称:nhglib,代码行数:33,代码来源:Assets.java

示例12: BehaviorTreeLibrary

import com.badlogic.gdx.assets.loaders.FileHandleResolver; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
	private BehaviorTreeLibrary (FileHandleResolver resolver, AssetManager assetManager, int parseDebugLevel) {
		this.resolver = resolver;
//		this.assetManager = assetManager;
		this.repository = new ObjectMap<String, BehaviorTree<?>>();
		this.parser = new BehaviorTreeParser(parseDebugLevel);
	}
 
开发者ID:Mignet,项目名称:Inspiration,代码行数:8,代码来源:BehaviorTreeLibrary.java

示例13: newResolver

import com.badlogic.gdx.assets.loaders.FileHandleResolver; //导入依赖的package包/类
@Override
public FileHandleResolver newResolver (final FileType fileType) {
	return new FileHandleResolver() {

		@Override
		public FileHandle resolve (String fileName) {
			return new DesktopFileHandle(fileName, fileType);
		}
	};
}
 
开发者ID:Mignet,项目名称:Inspiration,代码行数:11,代码来源:StandaloneFileSystem.java

示例14: AnimationControlLoader

import com.badlogic.gdx.assets.loaders.FileHandleResolver; //导入依赖的package包/类
public AnimationControlLoader(FileHandleResolver resolver, Tags tags) {
	super(resolver);
	
	logger.info("initialize");
	this.resolver = resolver;
	this.tags = tags;
}
 
开发者ID:saltares,项目名称:libgdxjam,代码行数:8,代码来源:AnimationControlLoader.java

示例15: AnimationStateDataLoader

import com.badlogic.gdx.assets.loaders.FileHandleResolver; //导入依赖的package包/类
public AnimationStateDataLoader(FileHandleResolver resolver) {
	super(resolver);
	
	logger = new Logger("AnimationStateDataLoader");
	data = null;
	
	logger.info("initialising");
}
 
开发者ID:saltares,项目名称:libgdxjam,代码行数:9,代码来源:AnimationStateDataLoader.java


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