libgdx

Changing font size in skin

好久不见. 提交于 2019-12-07 16:56:00
问题 I am writing a game using libgdx, and I borrowed the skin.json (and related files) from a tutorial. The font being used (default) was scaling in an ugly manner on denser screens, so I generated by own very large font - and in the game itself, I scale it to a reasonable size (basically I use BitmapFont.scale ). The font I'm now using is 3 times as large as the previous one. I changed the reference to which font to use in the skin.json file, and as a result, all my buttons, titles and other

libgdx liquidfun integration runtime error

一曲冷凌霜 提交于 2019-12-07 16:50:20
问题 I'm new to this. I generated a new project using libgdx project generator, all worked fine. Then I tried to add liquidfun extension to the library using the following tutorial: https://github.com/finnstr/gdx-liquidfun-extension/wiki/Setup. It compiles all the dependencies are seen in the editor but at runtime I get this error. java.lang.NoClassDefFoundError: Failed resolution of: Lcom/badlogic/gdx/physics/box2d/World; 10-09 10:29:50.698 12790-12895/com.mygdx.game.android E/AndroidRuntime: at

Libgdx Game - Texture Scaling

点点圈 提交于 2019-12-07 16:39:37
问题 I am using LibGdx to develop a simple game for Android devices. I wish to show a progress bar using the Texture by scaling it up / down. When we do scaling the image is changing in its shape. Could you please let me know a best approach to achieve the below mentioned scenario. Scale up is fine.. Scale down is really a problem. 回答1: If you want to do it purely by scaling, you can do one of the following Use a mask on the green bit (use for example the blue part as a mask) Chop the green part

Adding multiple windows in LibGDX?

与世无争的帅哥 提交于 2019-12-07 16:10:30
问题 I want to create multiple game windows from my DekstopLauncher.java . The second one should be able to interact with the first one, for example asking for a string. Is it possible to do so? And how? This is what I tried in the DeskopLauncher class: This is creating the first window: LwjglApplicationConfiguration configForTiles = new LwjglApplicationConfiguration(); TilePresets tilesWindow = new TilePresets(); LwjglApplication tiles = new LwjglApplication(tilesWindow, configForTiles); And this

Get key code as well as key modifiers on key press

我的未来我决定 提交于 2019-12-07 15:55: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

Running Libgdx Eclipse apps in iOS Simulator via RoboVM

元气小坏坏 提交于 2019-12-07 15:40:59
问题 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

In game Images disappear on Android device if i run from widget, but not when I install apk first time

时光总嘲笑我的痴心妄想 提交于 2019-12-07 15:17:03
问题 I created a game in with LibGDX, which works fine on my computer. I created a debug .apk in Android Studio via the Gradle View -> Build & then copied my android-debug.apk & android-debug-unaligned.apk to the download folder of my Android Device. Now when on my android device I clicked on one of my files the device ask if I wanna install it and choose yes and subsequently I open my game and it run fine. Now the porblem occurs when i quite the game and try to restart the game from the widget

How to match user click and the sprite object position in libGDX framework

巧了我就是萌 提交于 2019-12-07 12:58:09
问题 I am using libGDX java framework for developing a practice game in Eclipse. My game is in landscape mode and I am using sprite image for game assets .Actually i am trying to follow the kilobolt ZombieBird tutorial I have set orthographic camera like this -- > cam = new OrthographicCamera(); cam.setToOrtho(true, 250, 120); I have done this because my background texture region is of 250 x 120 px in the sprite image. So basically my sprite image is small in size and it is getting scaled

Drawing textured polygons with libgdx

烈酒焚心 提交于 2019-12-07 12:36:56
问题 I'm having a problem with my rendering cycle using libgdx, basically I need to fill an area with a square texture, and the last part of this area may be smaller or with a different shape than the texture, so it means that i need to render a quad of arbitrary form and slap the texture on it, cutting the parts I don't need. I'm a bit lost on how to do this, so far I've seen that the PolygonRegion and PolygonSpriteBatch might do it for me, but I'm a bit wary of instancing a new heavy object I'll

Native libraries not running on the device

只谈情不闲聊 提交于 2019-12-07 10:54:27
问题 I've put armeabi,armeabi-v7a folders into libs folder and not in maven repository. But I am getting following error while using libgdx: The library 'gdx-backend-jogl-natives.jar' contains native libraries that will not run on the device. The following libraries were found: libgluegen-rt-linux32.so -libgluegen-rt.jnilib libgluegen-rt-linux64.so libjogl.jnilib libjogl_awt.jnilib libjogl_awt-linux32.so libjogl_awt-linux64.so libjogl-linux32.so libjogl-linux64.so liblwjgl.jnilib liblwjgl.so