com.badlogic.gdx.Files.FileType Java Examples

The following examples show how to use com.badlogic.gdx.Files.FileType. 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: Invaders.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void create () {
	Array<Controller> controllers = Controllers.getControllers();
	if (controllers.size > 0) {
		controller = controllers.first();
	}
	Controllers.addListener(controllerListener);

	setScreen(new MainMenu(this));
	music = Gdx.audio.newMusic(Gdx.files.getFileHandle("data/8.12.mp3", FileType.Internal));
	music.setLooping(true);
	music.play();
	Gdx.input.setInputProcessor(new InputAdapter() {
		@Override
		public boolean keyUp (int keycode) {
			if (keycode == Keys.ENTER && Gdx.app.getType() == ApplicationType.WebGL) {
				if (!Gdx.graphics.isFullscreen()) Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayModes()[0]);
			}
			return true;
		}
	});

	fps = new FPSLogger();
}
 
Example #2
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 #3
Source File: Main.java    From bladecoder-adventure-engine with Apache License 2.0 6 votes vote down vote up
public static void main(final String[] args) {
	LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();

	cfg.title = "Adventure Editor v" + Versions.getVersion();

	cfg.resizable = true;
	cfg.vSyncEnabled = true;
	// cfg.samples = 2;
	// cfg.useGL30 = true;

	if (Main.class.getResource("/images/ic_app64.png") != null)
		cfg.addIcon("images/ic_app64.png", FileType.Internal);

	if (Main.class.getResource("/images/ic_app32.png") != null)
		cfg.addIcon("images/ic_app32.png", FileType.Internal);

	if (Main.class.getResource("/images/ic_app16.png") != null)
		cfg.addIcon("images/ic_app16.png", FileType.Internal);

	parseArgs(args);

	new Main(new Editor(), cfg);
}
 
Example #4
Source File: FilePopupMenu.java    From vis-ui with Apache License 2.0 6 votes vote down vote up
public void build (Array<FileHandle> favorites, FileHandle file) {
	sortingPopupMenu.build();
	this.file = file;

	clearChildren();

	addItem(newDirectory);
	addItem(sortBy);
	addItem(refresh);
	addSeparator();

	if (file.type() == FileType.Absolute || file.type() == FileType.External) addItem(delete);

	if (file.type() == FileType.Absolute) {
		addItem(showInExplorer);

		if (file.isDirectory()) {
			if (favorites.contains(file, false))
				addItem(removeFromFavorites);
			else
				addItem(addToFavorites);
		}
	}
}
 
Example #5
Source File: URacerDesktop.java    From uracer-kotd with Apache License 2.0 6 votes vote down vote up
private static LwjglApplicationConfiguration createLwjglConfig (BootConfig boot) {
	LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();

	// set to uracer defaults
	config.addIcon("data/base/icon.png", FileType.Internal);
	config.title = URacer.Name + " (" + URacer.versionInfo + ")";
	config.resizable = false;
	config.samples = 0;
	config.audioDeviceSimultaneousSources = 32;

	if (Config.Debug.PauseDisabled) {
		config.backgroundFPS = 0;
		config.foregroundFPS = 0;
	} else {
		config.backgroundFPS = 60;
		config.foregroundFPS = 60;
	}

	// apply boot config
	config.width = boot.getInt(BootConfigFlag.WIDTH);
	config.height = boot.getInt(BootConfigFlag.HEIGHT);
	config.vSyncEnabled = boot.getBoolean(BootConfigFlag.VSYNC);
	config.fullscreen = boot.getBoolean(BootConfigFlag.FULLSCREEN);

	return config;
}
 
Example #6
Source File: DesktopLauncher.java    From libgdx-2d-tutorial with MIT License 5 votes vote down vote up
public static void main (String[] arg) {
	LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
	config.foregroundFPS = 60;
	config.width = SpaceGame.WIDTH;
	config.height = SpaceGame.HEIGHT;
	config.resizable = true;
	config.addIcon("icon_128.png", FileType.Internal);
	config.addIcon("icon_32.png", FileType.Internal);
	config.addIcon("icon_16.png", FileType.Internal);
	new LwjglApplication(new SpaceGame(), config);
}
 
Example #7
Source File: DesktopLauncher.java    From bladecoder-adventure-engine with Apache License 2.0 5 votes vote down vote up
public void run() {
	if(DesktopLauncher.class.getResource("/icons/icon128.png")!=null)
		cfg.addIcon("icons/icon128.png", FileType.Internal);
	
	if(DesktopLauncher.class.getResource("/icons/icon32.png")!=null)
		cfg.addIcon("icons/icon32.png", FileType.Internal);
	
	if(DesktopLauncher.class.getResource("/icons/icon16.png")!=null)
		cfg.addIcon("icons/icon16.png", FileType.Internal);		
	
	new LwjglApplication(this, cfg);
}
 
Example #8
Source File: EngineSoundSet.java    From uracer-kotd with Apache License 2.0 5 votes vote down vote up
public EngineSoundSet () {
	rpm = 0;
	gear = 1;

	//@off
	feIdle = FIS.load(Gdx.files.getFileHandle("data/audio/car-engine/fuzzy/engineVolIdle.fcl", FileType.Internal).read(), true);
	feOnLow = FIS.load(Gdx.files.getFileHandle("data/audio/car-engine/fuzzy/engineVolOnLow.fcl", FileType.Internal).read(), true);
	feOnMid= FIS.load(Gdx.files.getFileHandle("data/audio/car-engine/fuzzy/engineVolOnMid.fcl", FileType.Internal).read(), true);
	feOnHigh = FIS.load(Gdx.files.getFileHandle("data/audio/car-engine/fuzzy/engineVolOnHigh.fcl", FileType.Internal).read(), true);
	feOffLow = FIS.load(Gdx.files.getFileHandle("data/audio/car-engine/fuzzy/engineVolOffLow.fcl", FileType.Internal).read(), true);
	feOffMid= FIS.load(Gdx.files.getFileHandle("data/audio/car-engine/fuzzy/engineVolOffMid.fcl", FileType.Internal).read(), true);
	feOffHigh = FIS.load(Gdx.files.getFileHandle("data/audio/car-engine/fuzzy/engineVolOffHigh.fcl", FileType.Internal).read(), true);
	//@on
}
 
Example #9
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 #10
Source File: StandaloneFileSystem.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
public DesktopFileHandle (File file, FileType type) {
	super(file, type);
}
 
Example #11
Source File: StandaloneFileSystem.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
public DesktopFileHandle (String fileName, FileType type) {
	super(fileName, type);
}
 
Example #12
Source File: StandaloneFileSystem.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
public File file () {
	if (type == FileType.External) return new File(DesktopFileHandle.externalPath, file.getPath());
	if (type == FileType.Local) return new File(DesktopFileHandle.localPath, file.getPath());
	return file;
}
 
Example #13
Source File: StandaloneFileSystem.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
@Override
public FileHandle newFileHandle (File file, FileType type) {
	return new DesktopFileHandle(file, type);
}
 
Example #14
Source File: StandaloneFileSystem.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
@Override
public FileHandle newFileHandle (String fileName, FileType type) {
	return new DesktopFileHandle(fileName, type);
}
 
Example #15
Source File: StandaloneFileSystem.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
@Override
public FileHandle newFileHandle (File file) {
	return new DesktopFileHandle(file, FileType.Absolute);
}
 
Example #16
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 debug level and using the new internal resolver returned by the call
 * {@link FileSystem#newResolver(FileType) GdxAI.getFileSystem().newResolver(FileType.Internal)}.
 * @param parseDebugLevel the debug level the parser will use */
public BehaviorTreeLibrary (int parseDebugLevel) {
	this(GdxAI.getFileSystem().newResolver(FileType.Internal), parseDebugLevel);
}
 
Example #17
Source File: StandaloneFileSystem.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
@Override
public FileHandle newFileHandle (String fileName) {
	return new DesktopFileHandle(fileName, FileType.Absolute);
}
 
Example #18
Source File: GdxFileSystem.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
@Override
public FileHandle newFileHandle (File file, FileType type) {
	return Gdx.files.getFileHandle(file.getPath(), type);
}
 
Example #19
Source File: GdxFileSystem.java    From gdx-ai with Apache License 2.0 4 votes vote down vote up
@Override
public FileHandle newFileHandle (String fileName, FileType type) {
	return Gdx.files.getFileHandle(fileName, type);
}
 
Example #20
Source File: FileUtils.java    From libgdx-snippets with MIT License 4 votes vote down vote up
FileHandleHelper(File file, FileType type) {
	super(file, type);
}
 
Example #21
Source File: FileUtils.java    From libgdx-snippets with MIT License 4 votes vote down vote up
public static FileHandle newFileHandle(File file, FileType type) {
	return new FileHandleHelper(file, type);
}
 
Example #22
Source File: Sounds.java    From uracer-kotd with Apache License 2.0 4 votes vote down vote up
public static void init () {
	carDrift = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-tires/drift-loop.ogg", FileType.Internal));

	//@off

	carImpacts[0] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-crashes/impact-2.ogg", FileType.Internal)); // low1
	carImpacts[1] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-crashes/impact-3.ogg", FileType.Internal)); // low2
	carImpacts[2] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-crashes/impact-7.ogg", FileType.Internal)); // low3
	carImpacts[3] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-crashes/impact-8.ogg", FileType.Internal)); // low4
	carImpacts[4] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-crashes/impact-1.ogg", FileType.Internal)); // mid1
	carImpacts[5] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-crashes/impact-4.ogg", FileType.Internal)); // mid2
	carImpacts[6] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-crashes/impact-6.ogg", FileType.Internal)); // mid3
	carImpacts[7] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-crashes/impact-5.ogg", FileType.Internal)); // high

	musTensive[0] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "tensive/prologue-1.ogg", FileType.Internal));
	musTensive[1] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "tensive/prologue-2.ogg", FileType.Internal));
	musTensive[2] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "tensive/prologue-3.ogg", FileType.Internal));
	musTensive[3] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "tensive/prologue-4.ogg", FileType.Internal));
	musTensive[4] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "tensive/inciso-1.ogg", FileType.Internal));
	musTensive[5] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "tensive/inciso-2.ogg", FileType.Internal));
	musTensive[6] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "tensive/inciso-3.ogg", FileType.Internal));

	// f40
	carEngine_f40[0] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/f40/idle.wav", FileType.Internal));
	carEngine_f40[1] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/f40/onlow.wav", FileType.Internal));
	carEngine_f40[2] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/f40/onmid.wav", FileType.Internal));
	carEngine_f40[3] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/f40/onhigh.wav", FileType.Internal));
	carEngine_f40[4] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/f40/offlow.wav", FileType.Internal));
	carEngine_f40[5] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/f40/offmid.wav", FileType.Internal));
	carEngine_f40[6] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/f40/offhigh.wav", FileType.Internal));

	// a1 Boxster
	carEngine_a1[0] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/a1/idle_ext.wav", FileType.Internal));
	carEngine_a1[1] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/a1/on_2000_ext.wav", FileType.Internal));
	carEngine_a1[2] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/a1/on_3000_ext.wav", FileType.Internal));
	carEngine_a1[3] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/a1/on_6000_ext.wav", FileType.Internal));
	carEngine_a1[4] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/a1/off_2000_ext.wav", FileType.Internal));
	carEngine_a1[5] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/a1/off_3000_ext.wav", FileType.Internal));
	carEngine_a1[6] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/a1/off_6000_ext.wav", FileType.Internal));

	// f1 RF1V8
	carEngine_f1[0] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/f1/idle.wav", FileType.Internal));
	carEngine_f1[1] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/f1/onlow.wav", FileType.Internal));
	carEngine_f1[2] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/f1/onmid.wav", FileType.Internal));
	carEngine_f1[3] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/f1/onhigh.wav", FileType.Internal));
	carEngine_f1[4] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/f1/offlow.wav", FileType.Internal));
	carEngine_f1[5] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/f1/offmid.wav", FileType.Internal));
	carEngine_f1[6] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/f1/offhigh.wav", FileType.Internal));

	// muscle
	carEngine_msc[0] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/muscle/idle.wav", FileType.Internal));
	carEngine_msc[1] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/muscle/onlow.wav", FileType.Internal));
	carEngine_msc[2] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/muscle/onmid.wav", FileType.Internal));
	carEngine_msc[3] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/muscle/onhigh.wav", FileType.Internal));
	carEngine_msc[4] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/muscle/offlow.wav", FileType.Internal));
	carEngine_msc[5] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/muscle/offmid.wav", FileType.Internal));
	carEngine_msc[6] = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "car-engine/muscle/offhigh.wav", FileType.Internal));

	// menu sfx
	menuClick = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "menu-sfx/click1.ogg", FileType.Internal));
	menuRollover = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "menu-sfx/rollover2.ogg", FileType.Internal));
	menuSwitch = Gdx.audio.newSound(Gdx.files.getFileHandle(Storage.Audio + "menu-sfx/switch2.ogg", FileType.Internal));
	
	//@on
}
 
Example #23
Source File: PlayerEngineSoundEffect.java    From uracer-kotd with Apache License 2.0 4 votes vote down vote up
public PlayerEngineSoundEffect (TrackProgressData progressData) {
	feLoad = FIS.load(Gdx.files.getFileHandle("data/audio/car-engine/fuzzy/engineLoad.fcl", FileType.Internal).read(), true);
	load = 0;
	throttle = 0;
	soundset = new EngineF40(progressData);
}
 
Example #24
Source File: FileSystem.java    From gdx-ai with Apache License 2.0 votes vote down vote up
public FileHandle newFileHandle(File file, FileType type); 
Example #25
Source File: FileSystem.java    From gdx-ai with Apache License 2.0 votes vote down vote up
public FileHandle newFileHandle(String fileName, FileType type); 
Example #26
Source File: FileSystem.java    From gdx-ai with Apache License 2.0 votes vote down vote up
public FileHandleResolver newResolver(FileType fileType);