libgdx

json file for libgdx Table

喜欢而已 提交于 2019-12-07 05:04:27
I am trying to make a Table that has a Skin based on libgdx's default LabelStyle and BitmapFont through the use of a json file. (this file is supposed to hold the references of these two objects) In doing this I am getting some unclear errors. For instance: Exception in thread "LWJGL Application" com.badlogic.gdx.utils.SerializationException: Error reading file: ui/uiskin.json at com.badlogic.gdx.scenes.scene2d.ui.Skin.load(Skin.java:96) at com.badlogic.gdx.scenes.scene2d.ui.Skin.<init>(Skin.java:73) at com.naitsirc.Interpolation.Test.show(Test.java:47) at com.badlogic.gdx.Game.setScreen(Game

How correctly save game progress via libGDX Preferences on Android devices?

久未见 提交于 2019-12-07 04:53:09
问题 I am using next code. This code work fine on desktop version, but on Android device does not. return Gdx.app.getPreferences(PREFS_NAME) always is null. Why? Where I could make mistake? import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Preferences; public class BeatlesPreferences { // constants private static final String PREF_VIBRO = "vibro"; private static final String PREF_MUSIC_ENABLED = "musicenabled"; private static final String PREF_SOUND_ENABLED = "soundenabled"; private static

Importing “google-play-services_lib” into Eclipse crashes libgdx project

青春壹個敷衍的年華 提交于 2019-12-07 04:48:27
I am trying to add google ad banners for my libgdx android game. After following the guide https://github.com/libgdx/libgdx/wiki/Google-Mobile-Ads-in-Libgdx-(replaces-deprecated-AdMob) and importing "google-play-services_lib" the game can't be started anymore. I am using Eclipse Luna. Eclipse keeps loading until death. For the proper import do it this way: File -> Import -> Existing Android Project -> Browse the "google-play-services_lib" folder then make sure you have checked the "Copy project into workspace" box. After you have imported the google-play-services_lib: Right click to your

Issue with shaders/matrices - can't see object

自作多情 提交于 2019-12-07 03:27:29
问题 I'm attempting to put a cube on the screen and light it. I'd like a phong shading on the cube. When I run my code, I can see a background image but no cube. I'm fairly sure the cube itself is correct as I've managed to display it with a solid-colour shader. I've managed to get the shader program to compile but I can't see the cube at all. I don't know if GLES/LibGdx have a mechanism for run-time exceptions but I can't see anything in the logs. I'm assuming that The model is out of the field

Using libgdx with Android Studio

时光毁灭记忆、已成空白 提交于 2019-12-07 02:45:27
According to libgdx wiki ( http://goo.gl/fJgSab ): Android Studio is fully compatible with libGDX's Gradle based build system. How exactly should one proceed to import the Android project generated by libgdx into Android Studio? If you have created the project using libGDX gradle build system, you will have a file build.gradle in the root directory. Just open Android studio and import project and select this file. It will automatically fetch required resources and create your project structure in Studio. You just need to import your gradle project into Android Studio Migrating from Eclipse

Event not delivered to listener

只谈情不闲聊 提交于 2019-12-07 02:02:49
问题 I have a libgdx game that uses scene2d for the UI. I have several ImageButton instances with its own ClickListener . On some devices (only seen it on Samsung Galaxy S3 and Samsung Galaxy S4 Active so far) there is a problem with the event not being delivered unless one clicks twice quickly. Every time a click fails something like the following is logged: 04-22 16:10:09.678: D/InputReader(728): Input event: value=1 when=20897610551000 04-22 16:10:09.678: I/InputReader(728): Touch event's

Adding firebase to libgdx project built with gradle

て烟熏妆下的殇ゞ 提交于 2019-12-07 02:02:34
Here is my gradle.build. Im trying to add the firebase dependency so I can play with the simple login functions but gradle looks like it cant find the dependency. I copy and pasted what the firebase simple login example said to add to the build.gradle file but im coming up with this error. Included is the build.gradle file and a full stack trace of when I tried to build it from command line. buildscript { repositories { mavenCentral() mavenLocal() maven { url 'https://github.com/steffenschaefer/gwt-gradle-plugin/raw/maven-repo/' } } dependencies { classpath 'de.richsource.gradle.plugins:gwt

“You have not specified a View to use as content for popups”

安稳与你 提交于 2019-12-07 01:58:52
问题 So I've been trying to implement Leaderboards/Achievements in my game, and without any kind of implementation, the game runs just fine. I've successfully imported the google-play-services-lib and copied over BaseGameUtils. But whenever I try to call setup for a GameHelper object, it crashes it. LogCat gives the following error: getCSCPackageItemText() You have not specified a View to use as content view for popups. Falling back to the Activity content view which may not work properly in

Proper using of scene2d's Stage in a game with a huge world

谁说胖子不能爱 提交于 2019-12-07 00:50:07
问题 If the whole "game world" is thousands of times wider than a viewport, and if I want to use scene2d to manage game objects as Actor s, should I create Stage object as wide as the whole world, or should the Stage be some area around current viewport but not the whole world? In other words, does a Stage with greater width and height consume more memory itself, even if I render objects only on a small viewport-sized part of it? 回答1: I think you misunderstood what exactly a Stage is. A Stage

Deleting and creating body in libGDX

前提是你 提交于 2019-12-06 23:41:05
I have a problem with deleting/creating bodies in libGDX (box2d). I get a fatal error. Log: http://pastebin.com/fXWXpe8N I try to destroy bodies after collision. ~90% bodies are deleted good, without errors and crashes. But sometimes it happens. How can I fix this error? I have no idea. Contact: private void bulletGround(Contact contact) { Body bodyA = null; Body bodyB = null; if(contact.getFixtureA() != null && contact.getFixtureA().getUserData() != null && contact.getFixtureA().getUserData().equals(Ground.USERDATA)) bodyA = contact.getFixtureA().getBody(); if(contact.getFixtureB() != null &&