libgdx

How to make an executable out of my LIBGDX game

扶醉桌前 提交于 2019-12-05 19:20:15
问题 I've never made a program into an executable before, and I've been looking into how to do this for some time now. When I try to put it into a jar everything works fine but when I try to run it nothing happens. How do I make my game into an executable so it can be run (on windows, not android) I feel like I am not Linking it to the libraries or something... Not sure. Thanks! Edit: I should add I get the error JAR export finished with warnings. See details for additional information. duplicate

libgdx draw chinese characters

こ雲淡風輕ζ 提交于 2019-12-05 19:18:17
问题 I like to print Chinese text in my application. 1.When I try this, the screen will be empty. There is no error at the console. Create method: FreeTypeFontGenerator gen = new FreeTypeFontGenerator(Gdx.files.internal("fonts/DFLS1B.TTF")); font = gen.generateFont(40, "好", false); Render method: spriteBatch.setColor(1, 1, 1, 1); spriteBatch.begin(); font.draw(spriteBatch, "好", 10, 100); spriteBatch.end(); 2.When I try this, 3 different Chinese characters show up on screen but I have no idea why

how to use the libgdx contactlistener

橙三吉。 提交于 2019-12-05 19:17:32
问题 I've just began to work with the Libgdx's Box2d Engine but i simply do not understand when the methods of the Contactlistener should be called. There is on the one hand "begin contact" and on the other "end contact". Where should i call them, to get the Number of of a certain fixture touching others? And how do I implement the Contactlistener ? A redirec' to a Tutorial would answer my Question. I didn't find anything while searching google. This one helped me a lot but it is written for C++

LibGdx How to program an HP Bar?

那年仲夏 提交于 2019-12-05 19:17:15
I am currently trying to program a game using LibGdx. I have a lot of the structure part of my game and I am now seeking to have the game return information to the player. The simplest concept for my UI I can think of are HP bars and ammo counters (for bullets, arrows, etc.). Would this be done through a stage and actors in my GameScreen class? Perhaps in the Rendering class? Or is this a second camera (loaded-in after the background)? I use a GameScreen class supported by a Map and MapRenderer class to achieve my display. I will be looking to pick apart the LibGdx tests. Any information to

Draw a smooth line

喜夏-厌秋 提交于 2019-12-05 18:16:33
问题 I am developing a game using libgdx and i want to draw a smooth line using shape renderer. shaperenderer.begin(ShapeType.Line); shaperenderer.line(fisrstVec2,secondVec2); shaperenderer.end(); I have tried Multi Sample anti aliasing from libgdx blog. I have also went through Anti aliased filed shape in libgdx but unfortunately these line is not in latest verson of libgdx. Gdx.gl.glEnable(GL10.GL_LINE_SMOOTH); Gdx.gl.glEnable(GL10.GL_POINT_SMOOTH); 回答1: Enable anti-alising in the configuration:

taking screenshot in libgdx

余生长醉 提交于 2019-12-05 17:29:15
I have an application in which i want to take the screenshot of the game screen and save it as an image and upload to Facebook. I am using Libgdx and my focus is android. Can anyone help me that how to take screenshot of the game screen programmatically and save it as an image ?? Niklas It is now fairly easy. Libgdx provides an example, which can be found here . I had to add one statement to get it working. The image could not be saved directly to /screenshot1.png . Simply prepend Gdx.files.getLocalStoragePath() . Source Code: public class ScreenshotFactory { private static int counter = 1;

Libgdx 3D Texture Transparency

蓝咒 提交于 2019-12-05 16:57:26
I'm having a problem with a texture on a cylinder. Basically it is a coin with a texture on it, I have done this before as demo but lost the code. Now the problem I'm facing is that I cant get the edge of the coin to be transparent anymore. The transparent parts of the png appear white on the cylinder, or even the box I tried. I enabled G20.GL_Blend, have the blending function with alpha_src and one_minus_alpha_src, enabled something like texture_2d. (Srry for the wrong variable names, only on my phone atm, will change @home) I have tried everything I can find online, but it just doesnt change

Libgdx project for iOS displaying libgdx splash when compiling through robovm on simulator?

佐手、 提交于 2019-12-05 16:53:17
How can I remove libgdx splash screen which appears on iOS simulator but doesn't showed up in android emulator. I am compiling my libgdx project through robovm. Thanks You will need to replace the various "Default-" images which are in the RoboVM iOS project's "data" folder. These are the iOS "launch images" described here 来源: https://stackoverflow.com/questions/23004517/libgdx-project-for-ios-displaying-libgdx-splash-when-compiling-through-robovm-on

Unexpected results implementing simple motion blur in Libgdx

萝らか妹 提交于 2019-12-05 14:53:24
问题 In the two attached pictures, the desktop screenshot of libgdx functions as expected. The screenshot from my Galaxy Nexus is unfortunately not as expected. I am attempting to create a simple motion blur or trail effect. Rendering as I expected on my desktop. Not rendering as I expected on my Galaxy nexus. The circle textures are drawn in a for loop during rendering and the effect is achieved with a pixmap using the RGBA of 0, 0, 0, 0.1f that is drawn before the circles. screenClearSprite

libgdx throwing an exception on helloworld app when ran in emulator

眉间皱痕 提交于 2019-12-05 14:43:29
I've followed the tutorial on http://www.youtube.com/watch?v=vLx_72qxK_0&feature=player_embedded and created a simple app with the libgdx library that makes an application with a red background. This works fine when I run it as a stand alone desktop app, but when I run the -android version the exception below is thrown and the application fails to start. 02-04 18:25:27.536: W/dalvikvm(456): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/badlogic/gdx/backends/android/AndroidApplication; 02-04 18:25:27.536: W/dalvikvm(456): Class init failed in newInstance call (Lorg