當前位置: 首頁>>代碼示例>>Java>>正文


Java ApplicationType.Applet方法代碼示例

本文整理匯總了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");
		 */
	}
}
 
開發者ID:Quexten,項目名稱:RavTech,代碼行數:25,代碼來源:ShaderManager.java

示例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;
}
 
開發者ID:bladecoder,項目名稱:bladecoder-adventure-engine,代碼行數:25,代碼來源:EngineAssetManager.java

示例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;
}
 
開發者ID:bladecoder,項目名稱:bladecoder-adventure-engine,代碼行數:25,代碼來源:EngineAssetManager.java

示例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;
}
 
開發者ID:Quexten,項目名稱:RavTech,代碼行數:16,代碼來源:ShaderManager.java

示例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";
}
 
開發者ID:Murii,項目名稱:Tilo-game-framework,代碼行數:15,代碼來源:Tilo.java

示例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";
}
 
開發者ID:Murii,項目名稱:Tilo-game-framework,代碼行數:15,代碼來源:window.java

示例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);
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:37,代碼來源:Stage.java

示例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);
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:12,代碼來源:FloatFrameBuffer.java

示例9: isRunningOnApplet

import com.badlogic.gdx.Application.ApplicationType; //導入方法依賴的package包/類
public static boolean isRunningOnApplet() {
    return Gdx.app.getType() == ApplicationType.Applet;
}
 
開發者ID:gdx-libs,項目名稱:gdx-kiwi,代碼行數:4,代碼來源:GdxUtilities.java

示例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;
}
 
開發者ID:czyzby,項目名稱:gdx-lml,代碼行數:5,代碼來源:GdxUtilities.java


注:本文中的com.badlogic.gdx.Application.ApplicationType.Applet方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。