libgdx

libGDX Google Play Game Services - Android

ぐ巨炮叔叔 提交于 2019-12-06 02:37:56
问题 I am trying to implement Google play Game Services into libGDX project. In my android project, the MainActivity looks like this: public class MainActivity extends AndroidApplication implements GameHelper.GameHelperListener, ActionResolver { GameHelper gameHelper; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); gameHelper = new GameHelper(this, GameHelper.CLIENT_ALL); gameHelper.enableDebugLog(true); getWindow().addFlags(WindowManager

How do I prevent .git directory from getting copied to bin directory during rebuild?

老子叫甜甜 提交于 2019-12-06 01:55:32
A .git directory keeps reappearing in my project, inside a directory that I think should be ignored. It reappears each time I clean the project or refresh it in Eclipse. The duplicated .git directory results in redundant files that prevent the project from building. I have an Android project in Eclipse that links source from a Java project, which is the way LibGDX handles a project. The .git directory that I don't want contains a file that causes a conflict, so I have to delete it every time I want to build to device. It is creating the directory MyProject/bin/classes/.git. But I have bin/ in

Java - LibGDX - What is the difference between isKeyPressed and isKeyJustPressed?

廉价感情. 提交于 2019-12-06 01:34:15
问题 What is the difference between isKeyPressed and isKeyJustPressed?! I searched the docs. for the difference and just found: isKeyPressed: Returns whether the key is pressed. isKeyJustPressed: Returns whether the key has just been pressed. Anybody knows something that explains better?! 回答1: isKeyPressed detects whether the key is currently pressed. isKeyJustPressed detects whether the key was pressed and released the last frame. 来源: https://stackoverflow.com/questions/40979622/java-libgdx-what

Changing the certificate fingerprint for an existing application

故事扮演 提交于 2019-12-06 01:29:39
I have an existing application that i published in to google play. All was fine, until I have changed a computer and my sha1 fingerprint changed. Is there a possible way to change the sha1 for an existing application in google play developer console? if not, how can I deal with it? Thank you! If you remember, when you publish the app first time on your older computer, you generate a key.keystore in order to sign the apk file and publish to google play. You need to have the same file. When you want to sign the apk, it asks if you want to generate a new key or use an existing key. Since you have

LibGDX Background Image in FitViewport

喜欢而已 提交于 2019-12-06 01:15:55
So, I'm using LibGDX for my upcoming App. I use a FitViewport to ensure the 16:9 aspect ratio. So players with other aspect ratios than 16:9 will have black bars at sites. What is the best way, to draw a screen filling background image, that also covers the area, where the black bars would be? camera = new OrthographicCamera(); viewport = new FitViewport(WIDTH, HEIGHT, camera); viewport.apply(); camera.position.set(WIDTH / 2, HEIGHT / 2, 0); camera.update(); Thats how I set up my camera/viewport currently. I then draw stuff on it with a SpriteBatch. Gdx.gl.glClearColor(1, 1, 1, 1); That's how

Running Libgdx Eclipse apps in iOS Simulator via RoboVM

懵懂的女人 提交于 2019-12-06 00:46:20
I can't seem to get RoboVM to run apps in the iOS Simulator via Eclipse. I have followed this guide , but get this error: when I try to do a Run as..../iOS Simulator App (iPhone or iPad). I have also tried some of the LibGDX example applications and get the same message. I can't see any other error messages in the console. I have tried cleaning the project and recreated it several times from scratch. I have also deleted ~/.robovm/cache to force a rebuild. I have the following installed on my Mac Mini running OSX Lion: Eclipse 4.2 Kelper (64 bit) JDK 7 U40 RoboVM Eclipse plugin v0.0.5 XCode 4.3

LibGDX - How to smooth out actor drawable when scaling a Scene2d stage?

最后都变了- 提交于 2019-12-05 22:57:34
问题 This is my set-up: stage = new Stage(1280, 800, false); button = new Button(drawableUp, drawableDown); stage.add(button); this gets rendered as following: @Override public void render(float delta) { Gdx.gl.glClearColor(RED,GREEN,BLUE,ALPHA); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); stage.act(delta); stage.draw(); } The issue is that when the stage is shown on 1280x800 the button looks like that: If the stage is rescaled to e.g. 1280x736, the button drawable is scaled in the following way: Is

Switching from AndEngine to libgdx - what to know? [closed]

青春壹個敷衍的年華 提交于 2019-12-05 22:15:29
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 6 years ago . I've been testing with AndEngine for months, but still haven't produced any game prototypes. There are few reasons why I want to switch to libgdx: - AndEngine is using libgdx's INI wrapper for Box2d, but updates reach Andengine slowly - I'm primarily targeting Android, but having

Get key code as well as key modifiers on key press

天大地大妈咪最大 提交于 2019-12-05 21:39:41
When a user presses a key combination, I need to get key's code and which modifier keys ( Ctrl , Alt , Shift etc) are currently pressed, and choose an appropriate reaction based on that. Is there a cleaner way to do this than the following? (using InputProcessor#keyDown ): public boolean keyDown(int keycode) { boolean ctrl, alt, shift, ...; if (Gdx.input.isKeyPressed(Input.Keys.LEFT_SHIFT) || Gdx.input.isKeyPressed(Input.Keys.RIGHT_SHIFT)) { shift = true; } else if (/* same for ctrl */) { ctrl = true; } else /* same for other modifiers */ { //... } // Finally, choose an action based on the key

Libgdx change color of Texture at runtime

我怕爱的太早我们不能终老 提交于 2019-12-05 21:24:34
问题 In a game made with libgdx I have a TextureAtlas in which I have stored all the TextureRegion s for my Animation s of the Player . The Player by default has a blue T-Shirt (for example). Now I would like to be able to have more then one Player and each should have another T-Shirt color. So basically, I want to replace the blue with red for the second Player and with green for the 3rd Player and so on. I am sure I can do this with PixMap but wouldn't. Because then I lose the advantage of the