libgdx

LibGDX proguard

 ̄綄美尐妖づ 提交于 2019-12-11 06:01:26
问题 I have been trying to shrink the size of my libGDX game .jar. I have been trying to get proguard to work. Proguard keeps complaining about missing classes, or the output .jar won't run. I have tried all the existing configuration files I found for libGDX. Does anyone have experience with setting up proguard? 回答1: You can use the following configuration for libGDX: -dontwarn com.badlogic.gdx.** -dontnote com.badlogic.gdx.** -keepclassmembers class com.badlogic.gdx.graphics.Cubemap* { *; }

Embed a browser in Libgdx

半城伤御伤魂 提交于 2019-12-11 05:59:23
问题 I am writing a cross platform app(PC, iOS, Android) in Java. I would like to integrate facebook into this app. I have been trying to find a uniform method to login, since it is a cross-platform applicaiton. So I have been following Facebook's manual login to try an approach that will work on each platform. I am using restFB to handle the interaction with Facebook after I get the access token from the user. That last bit is causing difficulties. It seems the only way for me to get the users

How to show interstitial ad with multiple screens in libgdx?

房东的猫 提交于 2019-12-11 05:48:30
问题 I successfully implemented banner ad in my libgdx game, now i am trying to implementing interstitial ad. I want to show ad on the button click but the ad is not showing on the screen, i am using log to know if the ad is loading and it is loading everytime but not visible on the screen. i am using multiple screen classes in the game. I have watched several tutorials on it but nothing seems to work. public class AndroidLauncher extends AndroidApplication implements AdService{ private

LibGdx - Error loading json file from asset manager

青春壹個敷衍的年華 提交于 2019-12-11 05:35:35
问题 I am loading a skin using the assetmanager and keep getting an error because There is no Bitmapfont registered with name: font_dpb_59 . I am trying to use this font in my json-file to create a Label-style. I am adding fonts and atlas in the skins parameters, am I missing something here? I load my skin like this: ObjectMap<String, Object> font_map = new ObjectMap<String, Object>(); font_map.put("font_dpb_59", font_dpb_59); font_map.put("font_dpm_40", font_dpm_40); //... some more fonts manager

Mockito + PowerMock + TestNG + Libgdx

僤鯓⒐⒋嵵緔 提交于 2019-12-11 05:32:17
问题 I'm trying add the powermock library to the working project, but I'm getting errors. How I add it: 1) AbsTest extends PowerMockTestCase 2) Build.gradle dependencies 3) In some test add @PrepareForTest({SomeClass.class}) . After this step this error occured. In build.gradle all libraries are included. Error occured in a place where initialize HeadlessApplication for use Gdx.* static vars. All tests in project extend this class: abstract public class AbsTest extends PowerMockTestCase { static {

Is it possible in LibGDX's `scene2d` API to have the same Actor instance in multiple Stages?

本小妞迷上赌 提交于 2019-12-11 05:30:02
问题 I am making a program using the amazing libGDX +scene2d API and I structured it as follows: I have a single MyGame instance, holding a single PolygonSpriteBatch instance. There is an abstract MyScreen class, holding a MyStage class (see below) Then there are lots of different screen classes that inherit from MyScreen , and instantiate each other at will. (in all cases, removing the " My " gives you the name of the respective library class that it extends) This model worked fine, until I

What's causing the dark borders around letters using OpenGL?

余生长醉 提交于 2019-12-11 05:06:30
问题 Following on from this question. When I draw the letters I'm getting a dark border around some areas. Below is an example zoomed 4x. The letter on the left is drawn with OpenGL. The letter on the right is my bitmap font atlas in Photoshop colour adjusted to match what is being drawn by my game. As you can see, the 's' on the left has noticeable dark borders in some areas. I've played with various blending options but can't work out what's causing it. If someone could tell me what the cause is

Cannot show user input with a textfield

梦想的初衷 提交于 2019-12-11 04:56:47
问题 I'm trying to use a TextField to get some user input: public void render() { Gdx.gl.glClear(GL11.GL_COLOR_BUFFER_BIT); Gdx.gl.glClearColor(0, 0, 0, 0); batch.begin(); batch.end(); stage = new Stage(); Gdx.input.setInputProcessor(stage); Skin skin = new Skin(Gdx.files.internal("assets/uiskin.json")); TextButton btnLogin = new TextButton("Click", skin); btnLogin.setPosition(300, 300); btnLogin.setSize(300, 60); btnLogin.addListener(new ClickListener() { public boolean touchDown(InputEvent e,

Cannot resolve setScreen() method

烈酒焚心 提交于 2019-12-11 04:53:54
问题 I'm not new to libgdx, but when i ended up with my previous university project, and started new one, Android studio or IDEA cannot resolve setScreen method, other stuff works fine. Any ideas ? Hope for help. (project absolutely clear). 回答1: Creating a project in LibGdx gives you your core file which implements the ApplicationListener . What I gather you are referring to is extending the Game class with with you set Screen classes with. With the ApplicationListener . public class HelloWorld

How to keep the same jump height in libgdx

让人想犯罪 __ 提交于 2019-12-11 04:39:25
问题 I'm developing a 2D video game using libgdx. I ran into a problem when I try to make jumping a body. It does not jump as expected after making it moving to the right.(I can only move to the right or Jump) If the body jumps before it's moving to the right everything goes fine. But If I decide to make jumping the body after moving it to the right. The body no longer jumps to the same height (It jumps less high). And I don't figure out why.. My method to jump the body : if (player