libgdx

Libgdx Box2d screen resolution

心不动则不痛 提交于 2019-12-25 13:16:34
问题 I've read a bit about what other people do to deal with different screen resolutions but I'm still very confused. If I have high resolution images and sprites that I want to use, should i work with a screen that like 1080x1920 and than create some methods that scale down for lower resolution screen? Or should I try to compress it down to some middle ground resolution and scale up and down as necessary? Also can anyone give me a good example of how to to the scaling for different resolutions?

Libgdx Box2d screen resolution

两盒软妹~` 提交于 2019-12-25 13:16:08
问题 I've read a bit about what other people do to deal with different screen resolutions but I'm still very confused. If I have high resolution images and sprites that I want to use, should i work with a screen that like 1080x1920 and than create some methods that scale down for lower resolution screen? Or should I try to compress it down to some middle ground resolution and scale up and down as necessary? Also can anyone give me a good example of how to to the scaling for different resolutions?

LibGDX: ShapeRenderer drawing… nothing

给你一囗甜甜゛ 提交于 2019-12-25 12:08:25
问题 So drawing a shape should be really easy, right? Well, the following draws exactly nothing. ...why? Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); camera.update(); shapeRenderer.setProjectionMatrix(camera.combined); shapeRenderer.begin(ShapeRenderer.ShapeType.Filled); shapeRenderer.setColor(Color.WHITE); shapeRenderer.rect(WIDTH / 2, HEIGHT / 2, 50, 50); shapeRenderer.end(); 回答1: Make sure your camera is properly initialized. For Example: camera = new

Java Pool actions3d (remake libGDX actions) how to make a copy of action3d

纵然是瞬间 提交于 2019-12-25 11:56:32
问题 I have problem with making a NEW of object. Example classes that I'm using: public class Actions3d{ /** Returns a new or pooled action of the specified type. */ static public <T extends Action3d> T action3d(Class<T> type) { Pool<T> pool = Pools.get(type); T action = pool.obtain(); action.setPool(pool); return action; } static public AddAction addAction(Action3d action) { AddAction addAction = action3d(AddAction.class); addAction.setAction(action); return addAction; } static public

Java libgdx 1.20 version texture bug

故事扮演 提交于 2019-12-25 10:51:50
问题 For 2 days I've been trying to fix bug with fickering and distored textures in my game. I was serching on the internet and i tried a few solutions like using scene2d, but it didn't work. What should i do ? This screenshot shows the problem: as the character moves, one eye is sometimes bigger than the other: edit: I still got the problem widthdistored eye when i use sprite.setPosition((int) sprite.getX(), (int) sprite.getY()); every time before i render my character. When i use custom viewport

Java libgdx 1.20 version texture bug

半腔热情 提交于 2019-12-25 10:51:06
问题 For 2 days I've been trying to fix bug with fickering and distored textures in my game. I was serching on the internet and i tried a few solutions like using scene2d, but it didn't work. What should i do ? This screenshot shows the problem: as the character moves, one eye is sometimes bigger than the other: edit: I still got the problem widthdistored eye when i use sprite.setPosition((int) sprite.getX(), (int) sprite.getY()); every time before i render my character. When i use custom viewport

Libgdx Android - GL Thread (NullPointerException) & Missing Class File

妖精的绣舞 提交于 2019-12-25 10:19:30
问题 i'm using the LibGdx framework to create a game and I'm using Eclipse 4.4 (Luna). Whilst i'm debugging my application this method is breaking. @Override public void run() { setName("GLThread " + getId()); if (LOG_THREADS) { Log.i("GLThread", "starting tid=" + getId()); } try { guardedRun(); } catch (InterruptedException e) { // fall thru and exit normally } finally { sGLThreadManager.threadExiting(this); } } inside the GLSurfaceView Android class, with the stack trace: Thread [GLThread 232]

LibGdx Understanding the viewports and associtate it with a Scene2D

女生的网名这么多〃 提交于 2019-12-25 09:47:31
问题 Whenever I try to set my viewport to a Stage, the actors, that I puting into the Scene are blured and very large. I want to set my Game world size as a rectangle of 50x100 units and then scale everything (Sprites, actors, labels, fonts) according that units. Every state inharitate form a class State which provides render function etc. public abstract class State { public static final float GAME_SIZE_WIDTH = 50 ; public static final float GAME_SIZE_HEIGHT = 100 ; protected OrthographicCamera

GoogleApi Real Time Multiplayer pushing updates

我只是一个虾纸丫 提交于 2019-12-25 09:05:47
问题 i am using the Google Api to create a Real Time Multiplayer - Top down shooter game with libGDX. Player positions are send over "sendUnreliableMessage" on every call of the "render()" method : render() called. "Device A" sends the local Player position (x, y) and the moving direction over "sendUnreliableMessage". "Device B" recieves the message. Interpolates between the last position (x,y) and the new position (x,y). "Device B" moves the local enemy Player to the new positions. (Interpolated

LinearLayout covering entire screen?

送分小仙女□ 提交于 2019-12-25 08:17:55
问题 I recently made a game with LibGDX, and I added a LinearLayout in the MainActivity.java so that I could place an AdMob ad there. Everything is running fine and dandy, but the problem is the layout covers the entire screen with black, and I'm not able to load or play the game. Is there a way to make the LinearLayout right at the top of the screen (where most ads are), and have it exist there while allowing the game to loaded and be played? Because right now my app is just a black screen with