Skip to main content

Questions tagged [libgdx]

LibGDX is a cross-platform Java game development framework based on OpenGL (ES) that works on Windows, Linux, Mac OS X, Android, iOS and your WebGL enabled browser.

Filter by
Sorted by
Tagged with
41 votes
5 answers
10k views

How can I give the illusion of height to a ball in 2D?

In 2D top down soccer games, sometimes a ball is given the illusion of being in the air, like below: How can I achieve this?
Donald's user avatar
  • 524
25 votes
5 answers
33k views

How do I make an on-screen HUD in libgdx?

I'm new to libgdx, and I am finding I am getting stumped by the simplest of things. It seems to want me to do things a specific way, but the documentation won't tell me what that is. I want to make ...
Devin Carless's user avatar
24 votes
4 answers
10k views

How to animate abstract 2d top down water texture?

I currently implement a game with a top down view of the ocean. I use the following, a little abstract texture: The actual texture is transparent, I added the green-like color for clarity. The ...
morpheus05's user avatar
22 votes
3 answers
13k views

Play videos with LibGDX

Is there a way to play videos with LibGDX? I want to put a video as my splash screen in Android, but I dont want to use the Android SDK, because I am using LibGDX and I am almost finished :/
Rudy_TM's user avatar
  • 1,412
22 votes
4 answers
27k views

Resolution Independence in libGDX

How do I make my libGDX game resolution/density independent? Is there a way to specify image sizes as "absolute" regardless of the underlying density? I'm making a very simple kids game; just a bunch ...
ashes999's user avatar
  • 11.3k
20 votes
2 answers
35k views

Where are all the tutorials for libGDX? [closed]

I've searched online for help and tutorials on LibGDX but I couldn't really find any, except and the wiki for asking questions on stackexchange. Besides the source (demos) and wiki, is there any other ...
Blue's user avatar
  • 621
19 votes
3 answers
4k views

What libgdx project files can I ignore from version control?

In an automatically created libgdx project, what files can I safely tell Git (or other revision control systems) to ignore? I'm considering these: ...
Zhen's user avatar
  • 1,316
18 votes
2 answers
11k views

LibGDX - Check if currently on Android/Desktop

I'm using LibGDX and flixel-android to build a Desktop/Android game. It feels like there should be a way of checking to see if you're currently being run on an Android device, the Desktop, and so on, ...
mtrc's user avatar
  • 301
17 votes
2 answers
15k views

Why doesn't my android application rotate when I rotate my screen

I am building a game in LibGDX and the game screen orientation is in landscape. I want it to stay in landscape but I still want the user to be able to flip the device onto the other side and the ...
G3tinmybelly's user avatar
16 votes
3 answers
6k views

How do I move the camera in full pixel intervals?

Basically I want to stop the camera from moving in subpixels, as I think this leads to sprites visibly changing their dimensions if just ever so slightly. (Is there a better term for that?) Note that ...
Joschua's user avatar
  • 245
15 votes
3 answers
12k views

LibGDX Game vs ApplicationAdapter

When I create a new LibGDX project the main class of Core project extends ApplicationAdapter. Here is how it looks like. ...
Vahe Muradyan's user avatar
14 votes
1 answer
21k views

What are the differences betwen Texture, TextureRegion, TextureAtlas, Sprite and Image in libgdx?

I've searched around for tutorials. I've seen people using the above classes to load images. As according to my understanding, all of the classes can read in a non-power of two images, TextureRegion/...
user15783's user avatar
  • 347
14 votes
1 answer
21k views

How to match font size with screen resolution?

So I'm working on a game using LibGDX, and I have a problem. To make my game fit most resolutions, I created a base asset for each aspect ratio, for example, a main menu background image, I made it ...
Aon GoltzCrank's user avatar
14 votes
2 answers
14k views

Repeat texture in libgdx

How to fill region with repeated texture? Now I'm using next method: ...
eleven's user avatar
  • 399
14 votes
2 answers
13k views

How would I implement procedurally generated tiles in libgdx?

I'm creating a simple top down Zelda-esque game in libgdx, and I want to implement tile-based dungeons that are procedurally generated, similar to this. Libgdx does have a class called TiledMap which ...
camden's user avatar
  • 261
14 votes
2 answers
1k views

Graphics not being displayed on OUYA

I hope its not too early to be asking OUYA dev questions, but I just got my dev kit and I want to get my game running ASAP! I am using LibGDX as my framework for my game and launching the Android ...
Amplify91's user avatar
  • 1,217
13 votes
1 answer
7k views

How can I define a complex collision area on top of a tile map?

As many people recommended, I am using Tiled map editor to create a map for my game and it's great particularly because libgdx framework also provides with API for maps from Tiled. I understand I can ...
Tae-Sung Shin's user avatar
13 votes
2 answers
15k views

How do I make a pop-up window with Scene2D?

I have a main-menu screen with a logo and a bunch of buttons. When the Login-button is pressed, I pop up a dialogue asking for a username and password. This works fine, other than the "popping up". ...
Gibbo's user avatar
  • 276
13 votes
2 answers
7k views

How do some mobile games scale graphics so beautifully? [duplicate]

I'm working on my first Android game and have been struggling a bit with scaling. I've got 3 test devices 800x480, 1920x1080 and a 2560x1600 tablet. Some games look near perfect on all of them - many ...
Will Calderwood's user avatar
12 votes
4 answers
3k views

Java and Steam JVM deployment

I am currently considering my options for game development and deploying to Steam Greenlight. I really like Java with libGDX, especially for its cross platform Android potential, and I understand that ...
spectacularbob's user avatar
12 votes
4 answers
19k views

How do I render a PNG with transparency in LibGDX?

I'm building a simple tic-tac-toe example with LibGDX. I have simple images: cross, circle and board, all pngs created with GIMP with a transparent background. How ...
Vokail's user avatar
  • 436
12 votes
2 answers
1k views

Word game - board implementation?

I'm working on a boggle type game for android, using libgdx. The user is presented with a 4x4 grid of letters and must find words by dragging their finger over the letters. Unlike boggle I want used ...
andy mcevoy's user avatar
11 votes
2 answers
16k views

Problem to match font size to the screen resolution in libgdx

I'm having problems to show text on my game at same size on different screens, and I did a simple test. This test consists to show a text fitting at the screen, I want the text has the same size ...
Iñaki Bedoya's user avatar
11 votes
2 answers
4k views

Since Table.drawDebug is deprecated in libGDX, what should I use instead?

I am following the "Learning LibGDX Game Development" book to make a simple game. I am in the menu creation section where we create a stage and render it with debug borders. The book says to use <...
Shijima's user avatar
  • 377
11 votes
3 answers
3k views

How can I make expanding bullet pattern shapes?

I want to make a series of expanding bullet patterns that form shapes such as squares, triangles, etc. An example of what I'm after can be seen in the following video where when the stars are ...
lepton's user avatar
  • 251
11 votes
4 answers
2k views

Creating a Melee Weapon in Box2D (libGDX)

I am struggling with how to implement a melee weapon that can swing when a key is pressed. I am imagining two different attacks (stab and swing) I have tried creating two fixtures (character + ...
quidproquo's user avatar
11 votes
5 answers
1k views

Ledge climb animation and movement (2d platformer)

Struggling to make a decision on the implementation of a ledge climb mechanic for a physics driven 2d platformer. What is the best way to go about this without it getting overly complex? So far I ...
Adrian's user avatar
  • 121
10 votes
2 answers
9k views

How can I make a snake's tail follow the head?

Following an assignment and just getting started with libGDX by building a small Snake clone I've run into an issue that I'll probably be ashamed for in a little while. I currently have a snake's ...
Kilian's user avatar
  • 203
10 votes
1 answer
10k views

BitmapFont - where is getBounds method in new 1.6 libGDX

I download newest libgdx version 1.6 and i cant solve problem with center my BitmapFont text. Earlier in version 1.54 i used getBounds() method to find out width of text. Share your solutions, thanks
Pawelos's user avatar
  • 103
10 votes
1 answer
9k views

Box2D Difference Between WorldCenter and Position

So this problem has been brothering for a couple of days now. First off, what is the difference between say Body.getWorldCenter() and Body.getPosition(). I heard that WorldCenter might have to do ...
Free Lancer's user avatar
  • 1,283
10 votes
2 answers
2k views

How well do functional languages perform on Android?

This is a special case of this question that I feel is particularly pertinent. I'm working on a game for Android, and I'm planning on using Scala with libgdx. I'm planning on making a performant ...
Jason Baker's user avatar
9 votes
5 answers
4k views

How can I implement smooth tile-based lighting?

I have been working on a 2D tile game and I have implemented hard-edged lighting: I want it to be smoothed out a bit. I don't need shadows or anything, just simple lighting. I'd like it to look more ...
ProRed's user avatar
  • 340
9 votes
4 answers
9k views

LibGDX keep camera within bounds of TiledMap

I have a simple TiledMap which I can render fine. I have a player hopping (with Box2D) around and my camera follows the player around: ...
Ariejan's user avatar
  • 360
9 votes
2 answers
14k views

how to get width and height of TiledMap in the latest Version of Libgdx

I am making a tiled based game, I want not to let the camera show places, where there is no map... this is a obvious solution I got from a tutorial ...
Vishal Kumar's user avatar
9 votes
3 answers
11k views

Advantages and disadvantages of libgdx [closed]

I've been an android developer for a while and am thinking about getting into gaming. While looking for a game dev framework, I thought libgdx provides very friendly documentation and functionality. ...
Tae-Sung Shin's user avatar
9 votes
2 answers
4k views

How to draw table border in libgdx?

I'm new to libgdx and I'm currently working on TableLayout and wondering how could I draw borders for each cells. I've done some research on this but it seems that I could come up with this solution ...
user15783's user avatar
  • 347
9 votes
2 answers
6k views

How can I post scores to Facebook from a LibGDX Android game?

I am using LibGDX to create an Android game. I am not making the HTML backend of the game. I just want it to be on the Android Google Play store. Is it possible to post the scores to Facebook? And if ...
Vishal Kumar's user avatar
9 votes
2 answers
1k views

Libgdx black rectangles problem

I'm working on a game for Android using Android Studio with LibGDX in Java. I recently found a weird problem when closing and reopening the game. When I first open the game, it works fine. If I click ...
Gad Wissberg's user avatar
9 votes
1 answer
2k views

How do I induce collision events in LibGDX 3D?

In the code below I've put an example of something I want to do. I have the camera and I want it to stop moving whenever it hits one of the boxes, how do I do this? ...
SirMathhman's user avatar
9 votes
1 answer
1k views

How do I draw a name above monsters head?

My player HUD works perfect, but when I move, the monster name moves with me instead of getting attached to the monster. Player has a HUD and I'm using Scene2D.ui ...
Printer's user avatar
  • 317
9 votes
6 answers
2k views

Why can't I read .ttf file when running Android configuration?

When running or debugging my game on Android device, I get this error in the logcat: com.badlogic.gdx.utils.GdxRuntimeException: Error reading file: data/fonts/myFont.ttf (Internal) Which is ...
Davide Cattani's user avatar
8 votes
5 answers
2k views

How can I mark levels as "complete" in a way that prevents cheating?

My first thoughts about marking levels complete is to just write the information to a file upon level completion and load that in once the app is opened up again. But how could I keep this safe from ...
Madmenyo's user avatar
  • 1,979
8 votes
3 answers
21k views

How can I convert a tilemap to a Box2D world?

I want to use Box2D physics and lighting with a .tmx map. How can I "convert" a tilemap to Box2D world? My basic idea is to go through the tiles on the map and ...
HUNeater's user avatar
8 votes
4 answers
3k views

Making a Box2D ball bounce to constant height

I want to create a game like Doodle Jump. I'm using libgdx and Box2d. I needadvice on how to make my ball bounce constantly and with the same height. I've tried setting the ball's body restitution ...
Ion Farima's user avatar
8 votes
2 answers
2k views

Is it reasonable to use FreeType [closed]

Won't it slow my game if I use FreeType lib and convert 2 fonts from .ttf instead of using preloaded BitmapFont .png? Or may be FreeType so fast, that I can use fonts both ways? All I need is to ...
Divelix's user avatar
  • 107
8 votes
3 answers
2k views

How can I check if a player-drawn line follows a path?

I want to draw an invisible path that the user must follow. I've stored that path as points. When a player draws a line, how can I test if it follows the path I've stored? Here's an example for ...
Android's user avatar
  • 85
8 votes
2 answers
7k views

Getting Bodies to go "Super Fast" in Box2D

I am making a breakout game in Android using the LibGDX version of Box2D. I have a ball that I am applying a force to with the following code... ...
Jackie's user avatar
  • 455
8 votes
1 answer
8k views

Why is my sprite displayed offset from its Box2D body?

I found out about this using a debug renderer. When the game starts, everything is in order. But when a collision happens, the sprite's rotation is way larger than its body. The sprite and body match ...
Tae-Sung Shin's user avatar
8 votes
1 answer
3k views

Shaperenderer circle line width

Is there any way to increase the width of the line that makes up the shaperenderers circle? ...
Green_qaue's user avatar
  • 1,903
8 votes
4 answers
6k views

Detect if a sprite has left the camera in libgdx?

Is there a method to know if a sprite has left the camera of the stage? or I have to do my operations? :P
Rudy_TM's user avatar
  • 1,412

1
2 3 4 5
46