libgdx

Libgdx Box2D Velocity is just not fast enough

南笙酒味 提交于 2020-01-15 06:23:59
问题 I have a rectangle that I would like to move fast but for what ever reason the faster velocity I use still seems slow. What am I doing wrong? I have also dropped a circle from above onto a surface and even tough I play with gravity it comes down like a ballon... Some declarations float velocity = 10000000f; static final float BOX_STEP=1/60f; static final int BOX_VELOCITY_ITERATIONS=6; static final int BOX_POSITION_ITERATIONS=2; Gravity, tried everything and they all seem to suck world = new

LibGDX - Shader working on Desktop but not on Android

微笑、不失礼 提交于 2020-01-14 11:48:11
问题 I have written a simple program that renders a sphere in a 3d environment and colores it according to four light sources around the sphere. When I run the program on the desktop it works just fine but on an Android device the sphere is just plain colored. Here are images to illustrate what I am talking about: -> Desktop -> Android And here is the shader code: sphere.vert #ifdef GL_ES precision mediump float; #endif uniform mat4 u_projectionMatrix; uniform mat3 u_normalMatrix; uniform mat4 u

“signInSilently(): failure” when trying to sign in to GooglePlay Game Services with LibGDX

旧街凉风 提交于 2020-01-14 10:33:17
问题 I have been trying to add Google Game Services to my LibGDX project for the past 3 days now at first I tried the LibGDX tutorials but all of them seem to be outdated. Then I was advised to use the Google Game Services official code LibGDX: How to Implement Google Play Game Services? I imported the sample project TypeANumber and tried to add the code to my project but when I try to sign in I'm getting the "signInSilently(): failure" error and it crashes when I try to open the leaderboards and

LibGDX Uncaught RunTime Exception in HTML Deployment

夙愿已清 提交于 2020-01-14 09:48:08
问题 I seem to be getting an error when deploying my game to HTML. The menu screen works fine, then the transition to the game screen causes this error. Text from console : Uncaught java.lang.RuntimeException: com.google.gwt.core.client.JavaScriptException: (TypeError) gwt$exception: <skipped>: Cannot read property 'get_5' of null The errors seem to pile on by the millisecond as the window is kept open. The game runs perfectly on Desktop (windows and mac), Android, and iPhone. Not sure what's

Anti-aliasing filled shapes in libgdx

帅比萌擦擦* 提交于 2020-01-14 07:33:08
问题 I've been looking everywhere for a way to anti-alias edges of filled shapes drawn with ShapeRenderer (ie. ShapeType.Filled ) but can't find anything about this. Lines works well with Gdx.gl.glEnable(GL10.GL_LINE_SMOOTH) but nothing I've tried works with filled shapes. So, does anyone have any suggestions? 回答1: maybe this link will help: MULTI SAMPLING ANTI-ALASING IN LIBGDX ON ANDROID in general you have to enable multisampling to have edges of filled shapes smooth. http://www.opengl.org/wiki

Libgdx Box2D smooth angular rotation

荒凉一梦 提交于 2020-01-14 06:40:09
问题 I'm currently developing a flying game in libgdx where you can control the rotation of a bird with the mouse cursor. Right now the bird will instantly rotate to the cursor position. I'm aiming to make the bird rotation lag behind a little bit to make the flying seem more smooth. Rotational damping wont work because i am using the setTransform() method. I would be very happy about any suggestions, this is the code controlling the rotation, it's called every frame in the render method: //get

Repeating Texture on Model/Mesh

夙愿已清 提交于 2020-01-14 04:35:27
问题 When I just draw texture on SpriteBatch and set TextureWrap.Repeat everything is OK. But now I have 3D scene and I want have ground and texture must be repeated on model/mesh and this just don' t work. public static StillModel createPlainMesh(float xs, float zs, Texture texture) { final Mesh mesh = new Mesh(true, 4, 6, new VertexAttribute( Usage.Position, 3, "a_position"), new VertexAttribute( Usage.TextureCoordinates, 2, "a_texCoords")); mesh.setVertices(new float[] { xs, 0f, zs, 0, 0, xs,

libGDX Coordinate System

有些话、适合烂在心里 提交于 2020-01-14 03:05:17
问题 I'm trying to properly configure my Camera and Sprite s in libGDX to show up in a 2D coordinate system properly with the origin at the bottom left hand corner. I set up my Camera like this: cameraWidth = Gdx.graphics.getWidth(); cameraHeight = Gdx.graphics.getHeight(); camera = new OrthographicCamera(1, cameraHeight/cameraWidth); And I set up my Sprite s like this: sprite.setOrigin(sprite.getWidth()/2, sprite.getHeight()/2); sprite.setScale(scale); sprite.setPosition(startX,startY); My

Build failed in Android Studio 3.1, gradle 4.4 class signer information does not match signer information of other classes in the same package

我与影子孤独终老i 提交于 2020-01-13 07:28:09
问题 I'm making a project in Android Studio 3.1 with libgdx and i can't build my project because it says: class "org.bouncycastle.jcajce.provider.symmetric.IDEA$Mappings"'s signer information does not match signer information of other classes in the same package But i don't use "bouncycastle" or something I checked a lot pages and topics about this problem but i didn't find any solutions for this. Also i haven't any jar files and i never tried to sign something, i'm only trying to build my project

Providing Resources for Supporting Multiple Screens in Libgdx android

你离开我真会死。 提交于 2020-01-13 03:58:11
问题 In android I can supply alternative resources for many screen resolution such as drawable-hdpi, drawable-ldpi, and drawable-mdpi. Will libgdx realize it is working with a certain screen density and use the appropriate resource for it? 回答1: Libgdx doesn't directly support multi-resolution resources the way Android does. However, Libgdx does have some support. The ResolutionFileResolver class allows you to resolve file names to the best resolution. However, you are responsible for setting the