本文整理汇总了Java中com.badlogic.gdx.backends.lwjgl.LwjglFiles类的典型用法代码示例。如果您正苦于以下问题:Java LwjglFiles类的具体用法?Java LwjglFiles怎么用?Java LwjglFiles使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LwjglFiles类属于com.badlogic.gdx.backends.lwjgl包,在下文中一共展示了LwjglFiles类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.badlogic.gdx.backends.lwjgl.LwjglFiles; //导入依赖的package包/类
public static void main(String[] args)
{
SpringApplication.run(HeadlessServerLauncher.class, args);
ServerSettings.isHeadless = true;
LwjglNativesLoader.load();
Gdx.files = new LwjglFiles();
HeadlessNativesLoader.load();
MockGraphics mockGraphics = new MockGraphics();
Gdx.graphics = mockGraphics;
HeadlessNet headlessNet = new HeadlessNet();
Gdx.net = headlessNet;
Gdx.gl = new NullGL20();
Gdx.gl20 = new NullGL20();
Gdx.gl30 = new NullGL30();
HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
new HeadlessApplication(new GameServer(), config);
}
示例2: init
import com.badlogic.gdx.backends.lwjgl.LwjglFiles; //导入依赖的package包/类
@Override
public void init() {
if (Gdx.net != null) return;
BuildInfo.setTestBuildInfo("JUnitTest");
Gdx.net = new LwjglNet();
Gdx.files = new LwjglFiles();
Gdx.app = new DummyLogApplication() {
@Override
public ApplicationType getType() {
return ApplicationType.HeadlessDesktop;
}
};
Gdx.app.setApplicationLogger(new LwjglApplicationLogger());
}
示例3: main
import com.badlogic.gdx.backends.lwjgl.LwjglFiles; //导入依赖的package包/类
public static void main(String [] args) {
Gdx.files = new LwjglFiles();
UiTheme theme = new UiTheme();
theme.setId(UiTheme.DEFAULT_STYLE_ID);
theme.putFont("default", "example.ttf");
ButtonStyleRuleset buttonRuleset = new ButtonStyleRuleset();
ButtonStyleRule styleRule = new ButtonStyleRule();
styleRule.setAction("");
styleRule.setDisabled("");
styleRule.setFont("");
styleRule.setHover("");
styleRule.setNormal("");
styleRule.setTextColor("");
buttonRuleset.putStyleRule(ScreenSize.XS, styleRule);
theme.putButtonStyleRuleset(UiTheme.DEFAULT_STYLE_ID, buttonRuleset);
try {
Mdx.json.toJson(Gdx.files.absolute("/tmp/theme.json"), theme);
} catch (SerializationException e) {
e.printStackTrace();
}
}
示例4: main
import com.badlogic.gdx.backends.lwjgl.LwjglFiles; //导入依赖的package包/类
public static void main(String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
// Since Gdx.files is only set up once we launch an application and we
// therefore cant use that we need to provide Configs with a Files instance for
// loading our configurations.
Configs.setFiles(new LwjglFiles());
setupDisplay(config);
new LwjglApplication(new OnyxGame(), config);
}
示例5: initialGdx
import com.badlogic.gdx.backends.lwjgl.LwjglFiles; //导入依赖的package包/类
public static void initialGdx() {
if (Gdx.net != null) return;
BuildInfo.setTestBuildInfo("JUnitTest");
Gdx.net = new LwjglNet();
Gdx.files = new LwjglFiles();
Gdx.app = new DummyLogApplication() {
@Override
public ApplicationType getType() {
return ApplicationType.HeadlessDesktop;
}
};
Gdx.app.setApplicationLogger(new LwjglApplicationLogger());
CB.WorkPath = "!!!";
}
示例6: renamePrefixes
import com.badlogic.gdx.backends.lwjgl.LwjglFiles; //导入依赖的package包/类
private static void renamePrefixes(String path, String prefix, String newPrefix) {
Files files = new LwjglFiles();
for (FileHandle fileHandle : files.local(path).list()) {
if (fileHandle.name().startsWith(prefix)) {
String newName = newPrefix + fileHandle.name().substring(prefix.length());
println(fileHandle.name() + " -> " + newName);
fileHandle.sibling(newName).write(fileHandle.read(), false);
fileHandle.delete();
}
}
}
示例7: main
import com.badlogic.gdx.backends.lwjgl.LwjglFiles; //导入依赖的package包/类
public static void main (String[] arg) {
boolean shouldPack = arg.length == 1 && "pack".equals(arg[0]);
boolean shouldCompile = arg.length == 2 && "compile".equals(arg[0]);
if (shouldCompile) {
String folderName = arg[1];
ScriptCompiler compiler = new ScriptCompiler(folderName);
compiler.run();
return;
}
if (shouldPack) {
Settings settings = new Settings();
settings.maxHeight = 2048;
settings.maxWidth = 4096;
TexturePacker.process("bin/images", "bin", "uiStyle");
TexturePacker.process(settings, "bin/modules/showcase/ui/images/startGameMenu", "bin/modules/showcase/ui/", "startGameMenuStyle");
TexturePacker.process(settings, "bin/modules/showcase/ui/images/partyCreation", "bin/modules/showcase/ui/", "partyCreationStyle");
TexturePacker.process("bin/modules/showcase/ui/images/game", "bin/modules/showcase/ui/", "uiStyle");
TexturePacker.process("bin/modules/showcase/perks/images/small", "bin/modules/showcase/perks/images/", "perkImages");
TexturePacker.process("bin/modules/showcase/spells/images/small", "bin/modules/showcase/spells/images/", "spellImages");
}
Configuration.createConfiguration(new LwjglFiles());
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
cfg.title = "Fabulae";
cfg.width = Configuration.getScreenWidth();
cfg.height = Configuration.getScreenHeight();
cfg.fullscreen = Configuration.isFullscreen();
new LwjglApplication(new FishchickenGame(), cfg).setLogLevel(Application.LOG_DEBUG);
}
示例8: setupExternalFileOutput
import com.badlogic.gdx.backends.lwjgl.LwjglFiles; //导入依赖的package包/类
public static void setupExternalFileOutput() {
try {
Date currentDate = new Date();
long currentTime = currentDate.getTime();
String fileName = new SimpleDateFormat("yyMMddhhmm").format(currentDate) + ".log";
File logFile = new File(LwjglFiles.externalPath + AppConstants.LOGS_DIR + File.separator + fileName);
logFile.getParentFile().mkdirs();
for (File oldLogFile : logFile.getParentFile().listFiles((FileFilter)new SuffixFileFilter(LOG_FILE_EXTENSION))) {
long lastModified = oldLogFile.lastModified();
if (currentTime - lastModified > EXPIRATION_THRESHOLD) {
try { oldLogFile.delete(); } catch (SecurityException ignored) { }
}
}
FileOutputStream logFileOutputStream = new FileOutputStream(logFile);
System.setOut(new PrintStream(new OutputStreamMultiplexer(
new FileOutputStream(FileDescriptor.out),
logFileOutputStream
)));
System.setErr(new PrintStream(new OutputStreamMultiplexer(
new FileOutputStream(FileDescriptor.err),
logFileOutputStream
)));
System.out.println("Version: " + AppConstants.version);
System.out.println("OS: " + System.getProperty("os.name") + " " + System.getProperty("os.version") + " " + System.getProperty("os.arch"));
System.out.println("JRE: " + System.getProperty("java.version") + " " + System.getProperty("java.vendor"));
System.out.println("External log file: " + logFile.getAbsolutePath());
} catch (FileNotFoundException e) {
System.err.println("Can't setup logging to external file.");
e.printStackTrace();
}
}
示例9: loadWindowParams
import com.badlogic.gdx.backends.lwjgl.LwjglFiles; //导入依赖的package包/类
private void loadWindowParams(LwjglApplicationConfiguration configuration) {
FileHandle file = new FileHandle(LwjglFiles.externalPath + configuration.preferencesDirectory + "/window_params.xml");
if (!file.exists()) return;
DisplayMode displayMode = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode();
int screenWidth = displayMode.getWidth();
int screenHeight = displayMode.getHeight();
Preferences prefs = new LwjglPreferences(file);
configuration.width = MathUtils.clamp(prefs.getInteger("width", configuration.width), 320, screenWidth);
configuration.height = MathUtils.clamp(prefs.getInteger("height", configuration.height), 320, screenHeight);
configuration.x = MathUtils.clamp(prefs.getInteger("x", configuration.x), 0, screenWidth - configuration.width);
configuration.y = MathUtils.clamp(prefs.getInteger("y", configuration.y), 0, screenHeight - configuration.height);
}
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:15,代码来源:WindowParamsPersistingApplicationWrapper.java
示例10: main
import com.badlogic.gdx.backends.lwjgl.LwjglFiles; //导入依赖的package包/类
public static void main(String[] args) {
System.out.println("Generating Field classes ...");
System.out.println();
Files files = new LwjglFiles();
Json json = new Json();
FileHandle dir = files.internal(REPOCOMPONENTS_MAIN_PATH);
// Generate fields classes for all repo classes
buildCodeForAllClasses(files, json, dir, SCHEMAX_REPO_PACKAGE,
EDITOR_SCHEMA_DESTFOLDER);
}
示例11: generateBindingsFile
import com.badlogic.gdx.backends.lwjgl.LwjglFiles; //导入依赖的package包/类
public static void generateBindingsFile(String schemaFolder,
String schemaPackage, String schemaBindingsLocation) {
Files files = new LwjglFiles();
String bindings = "[\n ";
bindings += addBindings(files.internal(schemaFolder + schemaPackage),
schemaFolder);
int lastComma = bindings.lastIndexOf(',');
if (lastComma > 0) {
bindings = bindings.substring(0, lastComma);
}
bindings += "\n]";
new FileHandle(files.internal(schemaBindingsLocation).file())
.writeString(bindings, false);
}
示例12: main
import com.badlogic.gdx.backends.lwjgl.LwjglFiles; //导入依赖的package包/类
public static void main(String[] args) {
if (args.length != 2) {
System.err.println("Shadow Engine TMX to SMF converter");
System.err.println("Version: Don't even ask me.");
System.err.println("Usage: <process> <input> <output>");
return;
}
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
cfg.title = "shadow-tmx-to-smf";
cfg.useGL30 = false;
cfg.width = 600;
cfg.height = 480;
Files files = new LwjglFiles();
FileHandle input = files.internal(args[0]);
if (!input.exists()) {
input = files.absolute(args[0]);
}
if (input != null && !input.exists()) {
System.err.println("Input file doesn't exist internally nor absolutely!");
return;
}
FileHandle output = files.absolute(args[1]);
Converter converter = new Converter(input, output);
Converter.list.add(converter);
Converter.convertOnly = true;
BackendHelper.backend = new LWJGLBackend(cfg);
new LwjglApplication(new Shadow(), cfg);
}
示例13: setUp
import com.badlogic.gdx.backends.lwjgl.LwjglFiles; //导入依赖的package包/类
@Before
public void setUp() {
Gdx.files = new LwjglFiles();
Mdx.json = new JsonSerializer();
Mdx.xml = new DesktopXmlSerializer();
Mdx.di = new DesktopDependencyInjection();
desktopData = new DesktopPlayerData(TEST_IDENTIFIER);
createTestObjects();
}
示例14: TestList
import com.badlogic.gdx.backends.lwjgl.LwjglFiles; //导入依赖的package包/类
public TestList() {
setLayout(new BorderLayout());
final JList list = new JList(C2dTests.getNames());
final JButton button = new JButton("Run Test");
JScrollPane pane = new JScrollPane(list);
DefaultListSelectionModel m = new DefaultListSelectionModel();
m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
m.setLeadAnchorNotificationEnabled(false);
list.setSelectionModel(m);
list.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent event) {
if (event.getClickCount() == 2) button.doClick();
}
});
final Preferences prefs = new LwjglPreferences(new FileHandle(new LwjglFiles().getExternalStoragePath() + ".prefs/c2d-tests"));
list.setSelectedValue(prefs.getString("last", null), true);
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String testName = (String) list.getSelectedValue();
Engine test = C2dTests.newTest(testName);
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.fullscreen = false;
config.width = (int) Engine.getWidth();
config.height = (int) Engine.getHeight();
config.title = testName;
config.vSyncEnabled = true;
prefs.putString("last", testName);
prefs.flush();
new LwjglApplication(test, config);
}
});
add(pane, BorderLayout.CENTER);
add(button, BorderLayout.SOUTH);
}
示例15: main
import com.badlogic.gdx.backends.lwjgl.LwjglFiles; //导入依赖的package包/类
public static void main(String[] args) {
TGASHYGDataProvider tgashyg = new TGASHYGDataProvider();
TGASHYGDataProvider.setDumpToDisk(true, "bin");
tgashyg.setParallaxOverError(14.0);
try {
// Assets location
String ASSETS_LOC = (System.getProperty("assets.location") != null ? System.getProperty("assets.location") : "");
Gdx.files = new LwjglFiles();
// Thread idx
ThreadIndexer.initialize(new SingleThreadIndexer());
// Sys utils
SysUtilsFactory.initialize(new DesktopSysUtilsFactory());
// Initialize number format
NumberFormatFactory.initialize(new DesktopNumberFormatFactory());
// Initialize date format
DateFormatFactory.initialize(new DesktopDateFormatFactory());
ConfInit.initialize(new DesktopConfInit(new FileInputStream(new File(ASSETS_LOC + "conf/global.properties")), new FileInputStream(new File(ASSETS_LOC + "data/dummyversion"))));
I18n.initialize(new FileHandle(ASSETS_LOC + "i18n/gsbundle"));
ThreadLocalFactory.initialize(new SingleThreadLocalFactory());
EventManager.instance.subscribe(new TGASHYGToBinary(), Events.POST_NOTIFICATION, Events.JAVA_EXCEPTION);
tgashyg.loadData("nofile", 1);
} catch (Exception e) {
Logger.error(e);
}
}