當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。