本文整理汇总了Java中com.badlogic.gdx.Application.ApplicationType.Applet方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationType.Applet方法的具体用法?Java ApplicationType.Applet怎么用?Java ApplicationType.Applet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.Application.ApplicationType
的用法示例。
在下文中一共展示了ApplicationType.Applet方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ShaderManager
import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
public ShaderManager (String shaderDir, AssetManager am, boolean addProcessors) {
shaders = new ObjectMap<String, ShaderProgram>();
shaderPaths = new ObjectMap<String, String>();
sourcesVert = new ObjectMap<String, String>();
sourcesFrag = new ObjectMap<String, String>();
frameBuffers = new ObjectMap<String, FrameBuffer>();
openedFrameBuffers = new Array<String>(true, MAX_FRAMEBUFFERS);
screenCamera = new OrthographicCamera(Gdx.graphics.getWidth() + 2, Gdx.graphics.getHeight() + 2);
createScreenQuad();
screenCamera.translate(0, -1);
screenCamera.update();
setShaderDir(shaderDir);
setAssetManager(am);
// add("empty", "empty.vert", "empty.frag");
// add("default", "default.vert", "default.frag");
if (addProcessors && (Gdx.app.getType() == ApplicationType.Desktop || Gdx.app.getType() == ApplicationType.Applet
|| Gdx.app.getType() == ApplicationType.WebGL)) {
/*
* add("processor", "processor.vert", "processor.frag"); add("processor_blur", "processor.vert", "processor_blur.frag");
* add("copy", "processor.vert", "copy.frag"); add("processor_draw", "processor.vert", "processor_draw.frag");
* add("processor_fill", "processor.vert", "processor_fill.frag");
*/
}
}
示例2: getUserFile
import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
public FileHandle getUserFile(String filename) {
FileHandle file = null;
if (Gdx.app.getType() == ApplicationType.Desktop || Gdx.app.getType() == ApplicationType.Applet) {
String dir = Config.getProperty(Config.TITLE_PROP, DESKTOP_PREFS_DIR);
dir.replace(" ", "");
StringBuilder sb = new StringBuilder();
sb.append(".").append(dir).append("/").append(filename);
if (System.getProperty("os.name").toLowerCase().contains("mac")
&& System.getenv("HOME").contains("Containers")) {
file = Gdx.files.absolute(System.getenv("HOME") + "/" + sb.toString());
} else {
file = Gdx.files.external(sb.toString());
}
} else {
file = Gdx.files.local(NOT_DESKTOP_PREFS_DIR + filename);
}
return file;
}
示例3: getUserFolder
import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
public FileHandle getUserFolder() {
FileHandle file = null;
if (Gdx.app.getType() == ApplicationType.Desktop || Gdx.app.getType() == ApplicationType.Applet) {
String dir = Config.getProperty(Config.TITLE_PROP, DESKTOP_PREFS_DIR);
dir.replace(" ", "");
StringBuilder sb = new StringBuilder(".");
if (System.getProperty("os.name").toLowerCase().contains("mac")
&& System.getenv("HOME").contains("Containers")) {
file = Gdx.files.absolute(System.getenv("HOME") + "/" + sb.append(dir).toString());
} else {
file = Gdx.files.external(sb.append(dir).toString());
}
} else {
file = Gdx.files.local(NOT_DESKTOP_PREFS_DIR);
}
return file;
}
示例4: appendGLESPrecisions
import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
private String appendGLESPrecisions (String shader, String prec) {
if (shader == null)
return null;
if (Gdx.app.getType() == ApplicationType.Desktop || Gdx.app.getType() == ApplicationType.Applet)
return shader;
String tmp = "#ifdef GL_ES\n " + "precision " + prec + " float;\n" + "precision " + prec + " int;\n" +
// "precision " + prec + " vec2;\n" +
// "precision " + prec + " vec3;\n" +
// "precision " + prec + " vec4;\n" +
"#endif\n\n";
shader = shader.replace("vec2 ", prec + " vec2 ");
shader = shader.replace("vec3 ", prec + " vec3 ");
shader = shader.replace("vec4 ", prec + " vec4 ");
return tmp + shader;
}
示例5: getPlatform
import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
public static String getPlatform() {
ApplicationType type = Gdx.app.getType();
if (type == ApplicationType.Desktop)
return "desktop";
if (type == ApplicationType.Android)
return "android";
if (type == ApplicationType.iOS)
return "ios";
if (type == ApplicationType.Applet)
return "applet";
if (type == ApplicationType.WebGL)
return "web";
return "desktop";
}
示例6: platform
import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
public static String platform() {
ApplicationType type = Gdx.app.getType();
if (type == ApplicationType.Desktop)
return "desktop";
if (type == ApplicationType.Android)
return "android";
if (type == ApplicationType.iOS)
return "ios";
if (type == ApplicationType.Applet)
return "applet";
if (type == ApplicationType.WebGL)
return "web";
return "desktop";
}
示例7: act
import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
/** Calls the {@link Actor#act(float)} method on each actor in the stage. Typically called each frame. This method also fires
* enter and exit events.
* @param delta Time in seconds since the last frame. */
public void act (float delta) {
// Update over actors. Done in act() because actors may change position, which can fire enter/exit without an input event.
for (int pointer = 0, n = pointerOverActors.length; pointer < n; pointer++) {
Actor overLast = pointerOverActors[pointer];
// Check if pointer is gone.
if (!pointerTouched[pointer]) {
if (overLast != null) {
pointerOverActors[pointer] = null;
screenToStageCoordinates(tempCoords.set(pointerScreenX[pointer], pointerScreenY[pointer]));
// Exit over last.
InputEvent event = Pools.obtain(InputEvent.class);
event.setType(InputEvent.Type.exit);
event.setStage(this);
event.setStageX(tempCoords.x);
event.setStageY(tempCoords.y);
event.setRelatedActor(overLast);
event.setPointer(pointer);
overLast.fire(event);
Pools.free(event);
}
continue;
}
// Update over actor for the pointer.
pointerOverActors[pointer] = fireEnterAndExit(overLast, pointerScreenX[pointer], pointerScreenY[pointer], pointer);
}
// Update over actor for the mouse on the desktop.
ApplicationType type = Gdx.app.getType();
if (type == ApplicationType.Desktop || type == ApplicationType.Applet || type == ApplicationType.WebGL)
mouseOverActor = fireEnterAndExit(mouseOverActor, mouseScreenX, mouseScreenY, -1);
// Run actions and determine whether to request rendering (for when setContinuousRendering is off)
root.act(delta);
}
示例8: setupTexture
import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
/** Override this method in a derived class to set up the backing texture as you like. */
protected void setupTexture () {
FloatTextureData data = new FloatTextureData(width, height);
colorTexture = new Texture(data);
if (Gdx.app.getType() == ApplicationType.Desktop || Gdx.app.getType() == ApplicationType.Applet)
colorTexture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
else
// no filtering for float textures in OpenGL ES
colorTexture.setFilter(TextureFilter.Nearest, TextureFilter.Nearest);
colorTexture.setWrap(TextureWrap.ClampToEdge, TextureWrap.ClampToEdge);
}
示例9: isRunningOnApplet
import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
public static boolean isRunningOnApplet() {
return Gdx.app.getType() == ApplicationType.Applet;
}
示例10: isRunningOnApplet
import com.badlogic.gdx.Application.ApplicationType; //导入方法依赖的package包/类
/** @return true if application type equals {@link ApplicationType#Applet}. */
public static boolean isRunningOnApplet() {
return Gdx.app.getType() == ApplicationType.Applet;
}