@Override public boolean keyTyped (char character) { Gdx.app.log("Input Test", "key typed: '" + character + "'"); return false; }
@Override public void run () { Gdx.app.log("TimerTest", "ping"); } }, 1, 1);
@Override public void cancelled () { Gdx.app.log("HttpRequestExample", "cancelled"); } });
@Override public void dispose () { Gdx.app.log("FullscreenTest", "disposed"); } }
public int lookUpPointerIndex (int pointerId) { int len = realId.length; for (int i = 0; i < len; i++) { if (realId[i] == pointerId) return i; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < len; i++) { sb.append(i + ":" + realId[i] + " "); } Gdx.app.log("AndroidInput", "Pointer ID lookup failed: " + pointerId + ", " + sb.toString()); return -1; }
@Override public boolean touchDown (int x, int y, int pointer, int button) { Gdx.app.log("Input Test", "touch down: " + x + ", " + y + ", button: " + getButtonString(button)); return false; }
@Override public void dispose () { managers.remove(app); Gdx.app.log(TAG, "removed manager for application, " + managers.size + " managers active"); } });
protected void logManagedCachesStatus () { Gdx.app.log(LOG_TAG, Mesh.getManagedStatus()); Gdx.app.log(LOG_TAG, Texture.getManagedStatus()); Gdx.app.log(LOG_TAG, Cubemap.getManagedStatus()); Gdx.app.log(LOG_TAG, ShaderProgram.getManagedStatus()); Gdx.app.log(LOG_TAG, FrameBuffer.getManagedStatus()); }
@Override public void onInputDeviceRemoved (int deviceId) { controllers.removeController(deviceId); Gdx.app.log(TAG, "device " + deviceId + " removed"); }
@Override public boolean keyDown (int keycode) { Gdx.app.log("GdxInputTest", "key down: " + keycode); return super.keyDown(keycode); }
@Override public void resume () { gatherControllers(true); Gdx.app.log(TAG, "controllers resumed"); }
protected void logManagedCachesStatus () { Gdx.app.log(LOG_TAG, Mesh.getManagedStatus()); Gdx.app.log(LOG_TAG, Texture.getManagedStatus()); Gdx.app.log(LOG_TAG, Cubemap.getManagedStatus()); Gdx.app.log(LOG_TAG, ShaderProgram.getManagedStatus()); Gdx.app.log(LOG_TAG, FrameBuffer.getManagedStatus()); }
@Override public void resize (int width, int height) { Gdx.app.log("FullscreenTest", "resized: " + width + ", " + height); batch.getProjectionMatrix().setToOrtho2D(0, 0, width, height); }
public void run () { setButtonDisabled(false); Gdx.app.log("NetAPITest", "HTTP request cancelled"); statusLabel.setText("HTTP request cancelled"); } });
@Override public void resize (int width, int height) { Gdx.app.log("Test", "app resized: " + width + "x" + height + ", Graphics says: " + Gdx.graphics.getWidth() + "x" + Gdx.graphics.getHeight()); } }
/** Logs the current frames per second to the console. */ public void log () { if (TimeUtils.nanoTime() - startTime > 1000000000) /* 1,000,000,000ns == one second */{ Gdx.app.log("FPSLogger", "fps: " + Gdx.graphics.getFramesPerSecond()); startTime = TimeUtils.nanoTime(); } } }
@Override public void create() { Gdx.app.log("GLES30Test", "GL_VERSION = " + Gdx.gl.glGetString(GL20.GL_VERSION)); batch = new SpriteBatch(); texture = new Texture(Gdx.files.internal("data/badlogic.jpg")); shaderProgram = new ShaderProgram(Gdx.files.internal("data/shaders/gles30sprite.vert"), Gdx.files.internal("data/shaders/gles30sprite.frag")); Gdx.app.log("GLES30Test", shaderProgram.getLog()); if (shaderProgram.isCompiled()) { Gdx.app.log("GLES30Test", "Shader compiled"); batch.setShader(shaderProgram); } }
@Override public void create () { batch = new SpriteBatch(); font = new BitmapFont(); tex = new Texture(Gdx.files.internal("data/badlogic.jpg")); DisplayMode[] modes = Gdx.graphics.getDisplayModes(); for (DisplayMode mode : modes) { System.out.println(mode); } Gdx.app.log("FullscreenTest", Gdx.graphics.getBufferFormat().toString()); }
@Override public void clicked (InputEvent event, float x, float y) { super.clicked(event, x, y); if (httpRequest != null) { Gdx.net.cancelHttpRequest(httpRequest); Gdx.app.log("NetAPITest", "Cancelling request " + httpRequest.getUrl()); statusLabel.setText("Cancelling request " + httpRequest.getUrl()); } } };