com.badlogic.gdx.assets.loaders.FileHandleResolver Java Examples

The following examples show how to use com.badlogic.gdx.assets.loaders.FileHandleResolver. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GdxFileSystem.java    From gdx-ai with Apache License 2.0 6 votes vote down vote up
@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
}
 
Example #2
Source File: EnvironmentUtil.java    From gdx-gltf with Apache License 2.0 5 votes vote down vote up
public static Cubemap createCubemap(FileHandleResolver resolver, String baseName, String midName, String extension, int lods, String [] faceNames) {
	FileHandle [] files = new FileHandle[6 * lods];
	for(int level = 0 ; level<lods ; level++){
		for(int face = 0 ; face < 6 ; face++){
			files[level*6+face] = resolver.resolve(baseName + faceNames[face] + midName + level + extension);
		}
	}
	FacedMultiCubemapData data = new FacedMultiCubemapData(files, lods);
	Cubemap cubemap = new Cubemap(data);
	cubemap.setFilter(TextureFilter.MipMap, TextureFilter.Linear);
	return cubemap;
}
 
Example #3
Source File: StandaloneFileSystem.java    From gdx-ai with Apache License 2.0 5 votes vote down vote up
@Override
public FileHandleResolver newResolver (final FileType fileType) {
	return new FileHandleResolver() {

		@Override
		public FileHandle resolve (String fileName) {
			return new DesktopFileHandle(fileName, fileType);
		}
	};
}
 
Example #4
Source File: BehaviorTreeLibrary.java    From gdx-ai with Apache License 2.0 5 votes vote down vote up
@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);
	}
 
Example #5
Source File: EngineAssetManager.java    From bladecoder-adventure-engine with Apache License 2.0 5 votes vote down vote up
private Resolution[] getResolutions(FileHandleResolver resolver, int worldWidth, int worldHeight) {
	ArrayList<Resolution> rl = new ArrayList<>();

	String list[] = null;

	String configRes = Config.getInstance().getProperty(Config.RESOLUTIONS, null);

	if (configRes != null) {
		list = configRes.split(",");
	} else {
		list = listAssetFiles("ui");
	}

	for (String name : list) {

		try {
			float scale = Float.parseFloat(name);

			EngineLogger.debug("RES FOUND: " + scale);

			Resolution r = new Resolution((int) (worldWidth * scale), (int) (worldHeight * scale), name);

			rl.add(r);
		} catch (NumberFormatException e) {

		}
	}

	Collections.sort(rl, new Comparator<Resolution>() {
		@Override
		public int compare(Resolution a, Resolution b) {
			return a.portraitWidth - b.portraitWidth;
		}
	});

	return rl.toArray(new Resolution[rl.size()]);
}
 
Example #6
Source File: EngineAssetManager.java    From bladecoder-adventure-engine with Apache License 2.0 5 votes vote down vote up
protected EngineAssetManager(FileHandleResolver resolver) {
	super(resolver);

	resResolver = new EngineResolutionFileResolver(resolver);
	setLoader(Texture.class, new TextureLoader(resResolver));
	setLoader(TextureAtlas.class, new TextureAtlasLoader(resResolver));
	setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(resolver));
	setLoader(BitmapFont.class, ".ttf", new FreetypeFontLoader(resolver));

	Texture.setAssetManager(this);
}
 
Example #7
Source File: EnvironmentUtil.java    From gdx-gltf with Apache License 2.0 5 votes vote down vote up
public static Cubemap createCubemap(FileHandleResolver resolver, String baseName, String extension, String [] faceNames) {
	Cubemap cubemap = new Cubemap(
			resolver.resolve(baseName + faceNames[0] + extension),  
			resolver.resolve(baseName + faceNames[1] + extension), 
			resolver.resolve(baseName + faceNames[2] + extension), 
			resolver.resolve(baseName + faceNames[3] + extension),
			resolver.resolve(baseName + faceNames[4] + extension),
			resolver.resolve(baseName + faceNames[5] + extension));
	cubemap.setFilter(TextureFilter.Linear, TextureFilter.Linear);
	return cubemap;
}
 
Example #8
Source File: BitmapFontLoader.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public BitmapFontLoader(FileHandleResolver resolver) {
  super(resolver);
}
 
Example #9
Source File: COFLoader.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public COFLoader(FileHandleResolver resolver) {
  super(resolver);
}
 
Example #10
Source File: TXTLoader.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public TXTLoader(FileHandleResolver resolver) {
  super(resolver);
}
 
Example #11
Source File: GdxFileSuggester.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public GdxFileSuggester(@NonNull FileHandleResolver resolver) {
  this.RESOLVER = Validate.notNull(resolver, "resolver cannot be null");
  this.FILTER = null;
}
 
Example #12
Source File: GdxFileSuggester.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public GdxFileSuggester(@NonNull FileHandleResolver resolver, @NonNull FilenameFilter filter) {
  this.RESOLVER = Validate.notNull(resolver, "resolver cannot be null");
  this.FILTER = Validate.notNull(filter, "filter cannot be null");
}
 
Example #13
Source File: VolumeControlledSoundLoader.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public VolumeControlledSoundLoader(@NonNull FileHandleResolver resolver,
                                   @NonNull VolumeController<Sound> controller) {
  super(resolver);
  this.controller = Validate.notNull(controller, "VolumeController cannot be null");
}
 
Example #14
Source File: VolumeControlledMusicLoader.java    From riiablo with Apache License 2.0 4 votes vote down vote up
public VolumeControlledMusicLoader(@NonNull FileHandleResolver resolver,
                                   @NonNull VolumeController<Music> controller) {
  super(resolver);
  this.controller = Validate.notNull(controller, "VolumeController cannot be null");
}
 
Example #15
Source File: MG3dModelLoader.java    From Mundus with Apache License 2.0 4 votes vote down vote up
public MG3dModelLoader(BaseJsonReader reader, FileHandleResolver resolver) {
    super(resolver);
    this.reader = reader;
}
 
Example #16
Source File: EngineResolutionFileResolver.java    From bladecoder-adventure-engine with Apache License 2.0 4 votes vote down vote up
public EngineResolutionFileResolver(FileHandleResolver baseResolver) {
	this.baseResolver = baseResolver;
}
 
Example #17
Source File: EngineResolutionFileResolver.java    From bladecoder-adventure-engine with Apache License 2.0 4 votes vote down vote up
public FileHandleResolver getBaseResolver() {
	return baseResolver;
}
 
Example #18
Source File: MyNavTmxMapLoader.java    From Norii with Apache License 2.0 4 votes vote down vote up
public MyNavTmxMapLoader(FileHandleResolver resolver){
	this(resolver, "navigation", "walkable", "0");
}
 
Example #19
Source File: UAtlasTmxMapLoader.java    From uracer-kotd with Apache License 2.0 4 votes vote down vote up
public UAtlasTmxMapLoader (FileHandleResolver resolver) {
	super(resolver);
}
 
Example #20
Source File: SkeletonDataLoader.java    From bladecoder-adventure-engine with Apache License 2.0 4 votes vote down vote up
public SkeletonDataLoader(FileHandleResolver resolver) {
	super(resolver);
}
 
Example #21
Source File: HeadlessG3dModelLoader.java    From gdx-proto with Apache License 2.0 4 votes vote down vote up
public HeadlessG3dModelLoader(BaseJsonReader reader, FileHandleResolver resolver) {
	super(resolver);
	this.reader = reader;
}
 
Example #22
Source File: HeadlessModelLoader.java    From gdx-proto with Apache License 2.0 4 votes vote down vote up
public HeadlessModelLoader(FileHandleResolver resolver) {
	super(resolver);
}
 
Example #23
Source File: NavTmxMapLoader.java    From pathfinding with Apache License 2.0 4 votes vote down vote up
public NavTmxMapLoader(FileHandleResolver resolver){
	this(resolver, "navigation", "walkable", "0");
}
 
Example #24
Source File: NavTmxMapLoader.java    From pathfinding with Apache License 2.0 4 votes vote down vote up
public NavTmxMapLoader(FileHandleResolver handler, String navigationLayerName, String navigationProperty, String navigationClosedValue){
	super(handler);
	this.navigationLayerName = navigationLayerName;
	this.navigationProperty = navigationProperty;
	this.navigationClosedValue = navigationClosedValue;
}
 
Example #25
Source File: BehaviorTreeLoader.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
public BehaviorTreeLoader (FileHandleResolver resolver) {
	super(resolver);
}
 
Example #26
Source File: BehaviorTreeLibrary.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
/** Creates a {@code BehaviorTreeLibrary} with the given resolver.
 * @param resolver the {@link FileHandleResolver} */
public BehaviorTreeLibrary (FileHandleResolver resolver) {
	this(resolver, BehaviorTreeParser.DEBUG_NONE);
}
 
Example #27
Source File: BehaviorTreeLibrary.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
/** Creates a {@code BehaviorTreeLibrary} with the given resolver and debug level.
 * @param resolver the {@link FileHandleResolver}
 * @param parseDebugLevel the debug level the parser will use */
public BehaviorTreeLibrary (FileHandleResolver resolver, int parseDebugLevel) {
	this(resolver, null, parseDebugLevel);
}
 
Example #28
Source File: GLBAssetLoader.java    From gdx-gltf with Apache License 2.0 4 votes vote down vote up
public GLBAssetLoader(FileHandleResolver resolver) {
	super(resolver);
}
 
Example #29
Source File: GLTFAssetLoader.java    From gdx-gltf with Apache License 2.0 4 votes vote down vote up
public GLTFAssetLoader(FileHandleResolver resolver) {
	super(resolver);
}
 
Example #30
Source File: MidiSequenceLoader.java    From gdx-pd with Apache License 2.0 4 votes vote down vote up
public MidiSequenceLoader(FileHandleResolver resolver) {
	super(resolver);
}