libgdx

App not correctly configured to use Google Play services with a libgdx game

时光怂恿深爱的人放手 提交于 2020-01-16 18:49:09
问题 We develop a game using Libgdx which I'm trying to integrate with Google Play services. I'm interested in adding google multiplayer service. This is what I've done: MainActivity extends BaseGameActivity, and I've imported the BaseGameUtils project and the google-play-services_lib projects. I've added them both as Library projects of the game. I've created two client IDs in Google Developers console for both my product and my debug keys. I added my email as a tester in the Google Play

Integrating Google API into libgdx project

泪湿孤枕 提交于 2020-01-16 18:07:09
问题 I have followed Aryan's suggestion from this question LibGDX and the GoogleApiClient setup/integration (first time) but can't seem to get it to work. I created the ActionResolver and implemented it into my AndroidLauncher along with GameHelpListener, but the line gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES); gives me an error, saying that GameHelper cannot be applied to this(AndroidLauncher)... I have been struggling with this for days now and can't seem to get anywhere. Any

libgdx changing the texture on a pre textured model

心已入冬 提交于 2020-01-16 03:27:25
问题 I've exported a model from blender but I want some instances to use a different texture if (x % 2 == 0) { shipInstance.materials.clear(); shipInstance.materials.add(new Material()); shipInstance.materials.get(0).set(new TextureAttribute(TextureAttribute.Diffuse, enemyTexture)); unfortunately doesn't work! In a similar way I want to be able to change things like shininess and smoothing (I'm guessing you can change things like this that are using the default shader?) I've also (later) tried

Whats the 3rd argument in VertexAttribute() used for in libgdx?

佐手、 提交于 2020-01-15 09:14:49
问题 Hay, I'm going through the basic tutorial on libgdx's wiki, and I'm confused by the line new VertexAttribute(Usage.Position, 3, "a_position")); What is the string "a_position" used for? 回答1: the Mesh class works with OpenGL ES 1.x and 2.0. In OpenGL ES 1.x you use a fixed function pipeline (no shaders). Here the attribute does not have any use. In OpenGL ES 2.0 you write so called vertex and fragment shaders. If you send a Mesh (or rather its vertices) to your vertex/fragment shader pair,

Can't Run html libgdx with libgdx-utils

五迷三道 提交于 2020-01-15 09:04:07
问题 Im trying to compile my libgdx game, its working for android and desktop, but not HTML GWT. Im using Intellij / Gradle for the project. I just added the libgdx-utils extension lib found here which seems to be causing the error: https://bitbucket.org/dermetfan/libgdx-utils/wiki/Dependency%20Instructions The error i get when attempting this gradle command ./gradlew html:dist is: :html:compileGwt Compiling module com.xx.xx.GdxDefinition Validating units: [ERROR] Errors in 'file:/xx/xx/xx/screens

Can't Run html libgdx with libgdx-utils

假如想象 提交于 2020-01-15 09:03:32
问题 Im trying to compile my libgdx game, its working for android and desktop, but not HTML GWT. Im using Intellij / Gradle for the project. I just added the libgdx-utils extension lib found here which seems to be causing the error: https://bitbucket.org/dermetfan/libgdx-utils/wiki/Dependency%20Instructions The error i get when attempting this gradle command ./gradlew html:dist is: :html:compileGwt Compiling module com.xx.xx.GdxDefinition Validating units: [ERROR] Errors in 'file:/xx/xx/xx/screens

Body moving without any force applied? (Box2d)

痞子三分冷 提交于 2020-01-15 08:31:38
问题 So I am making a game in box 2d. In one part I need a ball which has a constant bounce height. I set the ball's restitution to 1 and am applying no force on it whatsoever (except gravity of course). Now this ball, on every bounce, bounces a bit higher everytime till it goes out of the top edge of the screen. What is wrong with this code? public class Ball implements ApplicationListener { World world ; Box2DDebugRenderer debugRenderer; OrthographicCamera camera; static final float BOX_STEP=1

Split parameter in a texture atlas file?

纵饮孤独 提交于 2020-01-15 08:00:27
问题 How exactly works the split parameter in a skin.atlas file. Libgdx texture packer creates these from 9-patches I believe. I need to manually add these sometimes (when using the texturepacker in the linked tag or when manually inserting/editing a texture) and cant seem to figure it out how they exactly work. Sometimes a single pixel makes my elements disappear or does not fill the split. Here is a example files: roundtext138.png format: RGBA8888 filter: Nearest,Nearest repeat: none button

Need help in using scene2d button in libgdx

廉价感情. 提交于 2020-01-15 07:11:48
问题 I am new to libGDX. I am trying to create a custom button by extending com.badlogic.gdx.scenes.scene2d.ui.Button. I want all the button related logic in this class. But I am not getting how to make the click work. I read many tutorials regarding adding Event Listeners but nothing is working. public class RestartButton extends Button { public RestartButton(ButtonStyle style) { super(style); } @Override public void draw(SpriteBatch batch, float parentAlpha) { batch.draw(TextureProvider

Need help in using scene2d button in libgdx

♀尐吖头ヾ 提交于 2020-01-15 07:11:12
问题 I am new to libGDX. I am trying to create a custom button by extending com.badlogic.gdx.scenes.scene2d.ui.Button. I want all the button related logic in this class. But I am not getting how to make the click work. I read many tutorials regarding adding Event Listeners but nothing is working. public class RestartButton extends Button { public RestartButton(ButtonStyle style) { super(style); } @Override public void draw(SpriteBatch batch, float parentAlpha) { batch.draw(TextureProvider