libgdx

Can't load libgdx desktop app on mac osx

半腔热情 提交于 2019-11-29 14:46:06
I have been developing a simple game using libgdx on my Windows 7 PC. Recently I bought a macbook pro (mountain lion). I downloaded and installed JRE 7 and eclipse, then cloned and imported the project. However though there are no errors in the code when I run the desktop version I the JVM loads and quickly dies. The error I get in the console is as follows: JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM _NSJVMLoadLibrary: NSAddLibrary failed for /libjawt.dylib JavaVM FATAL: lookup of function JAWT_GetAWT failed. Exit AL lib: ReleaseALC: 1 device not closed I've added JRE 7 to

Java Timer in GWT

依然范特西╮ 提交于 2019-11-29 14:33:52
I'm trying to have a Java Timer in my EntryPoint: Timer timer = new Timer(); timer.schedule( new TimerTask() { public void run() { //some code } } , 5000); But when trying to compile this I got: No source code is available for type java.util.Timer ; did you forget to inherit a required module? What can I do to fix this error? If you're using Libgdx, you can use the libgdx Timer infrastructure to schedule work to run in the future: Timer t = new Timer(); t.scheduleTask(new Timer.Task() { public void run() { /* some code */ } }), /* Note that libgdx uses float seconds, not integer milliseconds:

Google game services sign in issue (fails first attempt, successful second)

99封情书 提交于 2019-11-29 14:11:57
Currently trying to connect my game (that uses libgdx) to Google Game Services to enable leaderboard/achievements etc and seeing some strange behaviour. Problem When I first tap on "Sign in", it displays the dialog to choose your google account, then play services permission circles dialog, then the big loading circle. After a while, it displays a dialog with the following error Unknown issue with Google Play services If I tap 'Ok' to dismiss that error dialog, then tap on the "Sign in" button again, I immediately get successfully logged in. After this, I can see the leaderboard etc. Details

Rotate ModelInstance at specific point

笑着哭i 提交于 2019-11-29 12:40:07
How can i rotate ModelInstance at specific point( for example center of cube or corner of cube) ModelInstance inst; inst.transform.setToTranslation(cone.getX(),cone.getY(),cone.getZ()) .rotate(Vector3.Y,cone.getTiltOnY()).rotate(Vector3.X,cone.getTiltOnX()).rotate(Vector3.X,90); In my scenario i trying to rotate cone at its peek , but i rotate it in the middle. How i can set cone at coordinates as above, but rotate it at its peek. I need to do something like that : Gdx.gl10.glPushMatrix(); Gdx.gl10.glTranslatef(x,y,z); Gdx.gl10.glRotatef(angle,xaxis,yaxis,zaxis); mesh.render(); Gdx.gl10

Error while importing projects

ε祈祈猫儿з 提交于 2019-11-29 12:37:49
问题 While importing projects into eclipse i have this error: Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory. Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.11-all.zip'. As I have checked i need to set JAVA_HOME (i have the JDK on my computer), but i dont have a clue how to do that. 回答1: I had lots of similar problems and I

Libgdx background and foreground in single stage

青春壹個敷衍的年華 提交于 2019-11-29 12:27:55
My requirements: Background filling entire physical screen (stretching if required) Preserve aspect ratio of foreground assets (Work with virtual width and height) For this, I use two Stages in my Screen as shown in the code below. public void render(float delta) { backgroundStage.act(delta); backgroundStage.draw(); foregroundStage.act(delta); foregroundStage.draw(); } public void resize(int width, int height) { background.setWidth(width); background.setHeight(height); backgroundStage.setViewport(width, height, true); foregroundStage.setViewport(MainGame.WIDTH, MainGame.HEIGHT, true);

libgdx tiledmap flicker with Nearest filtering

徘徊边缘 提交于 2019-11-29 12:19:49
I am having strange artifacts on a tiledmap while scrolling with the camera clamped on the player (who is a box2d-Body). Before getting this issue i used the linear filter for the tiledmap which prevents those strange artifacts from happening but results in Texture bleeding (i loaded the tiledmap straight from a .tmx file without padding the tiles). However now i am using the Nearest filter instead which gets rid of the bleeding but when scrolling the map (by walking the character with the cam clamped on him) it seams like a lot of pixel are flickering around. The flickering results can get

How to resize a sprite in Libgdx?

别来无恙 提交于 2019-11-29 11:21:23
问题 I have a problem with the method sprite.setSize(float x, float y) in Libgdx. It does not affect the size or the dimensions of the sprite. They remains fixed whatever I pass to the setSize() method. here is my code : public class GameScreen implements Screen { OrthographicCamera camera; SpriteBatch batch; Texture carTexture; Sprite carSprite; public GameScreen() { } @Override public void render(float delta) { // TODO Auto-generated method stub Gdx.gl.glClearColor(0,0,0,0); Gdx.gl.glClear(GL10

Changes in code aren't reflected when I run Libgdx project on Android

折月煮酒 提交于 2019-11-29 11:08:15
I've been following the Libgdx tutorial here and I'm running into a strange problem. Due to the constraints of my work environment, I can't download OpenGL drivers on my desktop, so I can't test my application on the desktop. I have to test it on my Android device. It's running some variation of an Android 2.3.4 build, which is API level 10. The problem is, whenever I make changes to my code and run the Android application, the changes aren't reflected. It just starts the build it installed the first time I ran my code. I uninstalled the app on my Android and re-ran it, running into the same

Is there a max libGDX texture size for desktop?

与世无争的帅哥 提交于 2019-11-29 10:55:05
I know that on mobile devices, the largest texture you could render in a single draw differs: sometimes it is a mere 1024x1024 - other times 2048x2048 etc. What is the case for Desktop games? I am using OpenGL 2.0. I intend to draw one single background sprite that could be as big as 5000x5000. I am guessing that TexturePacker is not quite useful in this scenario, because I don't really need an atlas since I'm just trying to make a single sprite. Yes, I just tested for 5000x5000 and it works just fine. Just wondering if there's an actual limit to consider. Maybe it differs from one computer to