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
0
votes
1answer
21 views

Is there an algorithm for a Joystick class that happens to be engine/framework independent?

I need to be able to get the given input's distance inside the joystick, bounded within -100% and 100% and an unbounded version of it, get the position of where the mouse's position projects to the ...
3
votes
1answer
350 views

Rendering Tilemap Tile Layer Side by Side for Infinite/Endless Runner Game

I was strugeling this for days how to implement tilemap into libgdx and box2d with infinite/endless scheme. I can load a single map and display everything on screen. But placing 2 or more tilemap side ...
-1
votes
0answers
18 views

How to color provinces based on current ownership

I'm trying to make a Paradox-style map, where every color on the map represents a different province. Take a look at the maps on the EU3 wiki for examples. I have my province map, and each color is ...
0
votes
1answer
37 views

How to make the automatic movement of an actor and control that it does not go off the screen?

I have an actor in a class who then I put him in the main scene, but I want the actor to move randomly, that is, now he moves to the right, then down ... but controlling that he does not leave the ...
0
votes
1answer
46 views

LibGDX - Actors added to a stage from a network thread are not drawn

I have an application with several Screen and Actor. On my main screen, the actors added to the stage during creation are ...
0
votes
1answer
15 views

Vector2.Zero unexpected behaviour when used to initialize Vector2

I have base class which contains a Vector2 velocity field, which I was initializing in the constructor with Vector2.Zero. But ...
0
votes
1answer
1k views

What is a good approach to dynamically change actor Position?

In my card game there are 2 players with each player having a hand(a ListArray of of Cards.In this case its ...
0
votes
0answers
15 views
0
votes
1answer
80 views

LibGDX How to adjust mouse aim angle calculation when screen is resized

I'm starting with a screen resolution of 1280 x 960 and that is the default resolution where mouse aiming is calculated thus: ...
1
vote
2answers
262 views

Disposing objects when changing screens

I'm making my first game with LibGDX and Box2D, and I've realized that the memory used increases when I change screens. It starts from 150MB and progressively reaches 850. How should I deal with this? ...
0
votes
0answers
7 views

LibGDX TextButton removes numbers from string

I have been having a unique problem with the LibGDX TextButton. In some cases, when setting the text of the button, the string lacks numbers (even though they are present in the string which can be ...
1
vote
2answers
721 views

Problem with animating in Android, using batcher.draw in LibGDX

I am having a problem with the last part of the GameRenderer class. I call batcher.draw() and receive this error: The method ...
0
votes
1answer
65 views

LibGDX “EXCEPTION_ACCESS_VIOLATION” error when recreating previously disposed Box2DLights light

I just installed the Box2DLights dependency for LibGDX and I added a cave with 2 ConeLights inside. The first time I render the cave, everything works as expected. Then when I exit the cave, I make ...
1
vote
1answer
531 views

LibGDX Button and Table Layout

I want to change the position of the Buttons inside a table, I tried setting their X and Y, or get their position when adding the Buttons on the Table, but it didn't work. It always aligns the button ...
0
votes
1answer
938 views

Import and run LibGDX project in IntelliJ

I followed this guide to import a demos project, but when I set the class path of the module to the desktop, then click on the button of the main class field and select the ...
0
votes
2answers
910 views
0
votes
1answer
354 views

LibGdx table with label children at fixed positions

I'm trying to make a table containing three labels in each row. Something like this: Label1 Label2 Label3 Text1 Text2 LongerText LongTextLoremIpsum LongTextLoremIpsum LongTextLoremIpsum Is there ...
4
votes
2answers
487 views

Weird shader behavior on different devices

I'm trying to combine an ordinary shader with a Single Distance Field shader (for fonts and scalable icons) into one shader program. The idea is simple - if uv.x is less than 1.0, it is drawn as ...
1
vote
0answers
21 views

Libgdx sidebar like in Tibia

I'm new to LibGDX and I'm trying to make a simple RPG game. I've implemented a basic movement & combat system. Now I would like to add a sidebar with inventory, character information etc. (like in ...
0
votes
1answer
29 views

Incorporating HttpSession into libGDX communication

I wrote my server-side code prior to learning libGDX and writing my client-side code. Gdx.net provides for the http get communication I designed for, except for session authentication. I say that ...
3
votes
3answers
878 views

libGDX - How to rotate with a specific duration

I want to rotate my player to 90° for a specific duration. I know scene2d provides this, but I don't want to use it for my players. With how much to rotate every frame, so after x seconds the ...
0
votes
1answer
183 views

LibGDX FileHandle does not delete file

I'm using this line of code to delete a file: if(Gdx.files.local("/files/ids.json").exists()) { Gdx.files.local("/files/ids.json").delete(); } The same code ...
0
votes
1answer
45 views

Google Play Game Services Detecting Top 3 Players

I used Google Play Services Leaderboard in my Libgdx game. This is what I want to do; I would like to give awards to the best 3 players in this table. How can I help you? It automatically connects to ...
0
votes
1answer
674 views

LibGdx Positioning the camera

I've been following some tutorials about libGdx and I've tried to create a 2d platformer but I've got stuck at how would be the right way to make the camera not go out of the screen when the player ...
0
votes
1answer
213 views

InputListener not working on a custom Actor

Right now I am working on a UI for my game. I'm adding my own UI elements to a group and adding that to a stage. But the listeners I'm adding to the actors are not firing off at all. I have looked on ...
1
vote
1answer
205 views

Handling mouse input depending on selected unit and clicked tile

I am making a turn-based tactical game (think something like X-Com) and I am currently trying to figure out how to handle mouse input in a clean way without a mess of if-statements. I have a lot of ...
0
votes
2answers
187 views

libgdx - Problem occurring after collision detected

I have just implemented collision detection in my little 2d rpg-like game. I'm using Tiled for the maps, mechanism is simple - I have one layer called 'collision' in my tiled map, and while loading ...
0
votes
1answer
193 views

How can I avoid assets reload if an Android activity is re-created?

I've put my libGDX view inside a bigger Android layout. When the user rotates the screen, a new layout specific for the orientation is drawn, for this reason, the activity is rebuilt from scratch ...
0
votes
1answer
88 views

How to create a color aura around actors in libGDX?

Is there an easy mechanism to create a color aura around an actor in libGDX? Thanks for all tips!
0
votes
1answer
190 views

LIBGDX fadeout, hide and remove action not triggered

I try to execute an sequence of actions, but fadeout and following are not working for me. I can see the actor moving to the desired point, but after that it just stays there. My code. personActor is ...
0
votes
1answer
49 views

How can I add a button that opens a pop-up?

I have developed a game with a libGDX game engine. I want to create a button on the game screen and add a popup to this button. How can I do this? My current code: ...
0
votes
1answer
101 views

Parts of OpenGL rendering area missing/transparent until resize

I am having a weird transparency issue when running my game in windowed mode. Parts of the window, left and top parts in normal window mode, right and bottom when in maximised window, become ...
3
votes
2answers
648 views

Strange LibGdx box2d body.ApplyLinearImpulse(); behavior

I have been working on this game NinjaThief and when I apply linear impulse to player body it just keeps on moving. Some of the functions are still unfinished so it looks a bit messy. Here is my code:...
1
vote
1answer
613 views

Calculating World Unit or Pixels Per Unit values

Is there a formula to calculate world unit or pixels per unit values in LibGdx? Most of my objects fit into a 32x32 or 16x16 frame. When the objects are close to 32x32, and I use ...
4
votes
2answers
2k views

Libgdx Scene2D Table background not showing up

I am using Libgdx's Scene2D API to build my UI and everything has been working as expected until now. I created a Skin and a ...
1
vote
1answer
671 views

LibGDX: creating actor conformed by other actors

I am making my custom actor class, made up by 3 actors(oneProgressBar, one Label and one ...
3
votes
1answer
636 views

Moving sprite using the accelerometer in LibGDX?

I don't know how to use accelerometer in LibGDX; how could I use the the motion sensor? I'm working for a top down game with the motion sensor. I'm new to this framework. My sprite image is already ...
0
votes
2answers
5k views

SpriteBatch being drawn outside of Stage?

Currently working on my first game, though running into some problems with libgx and screen aspect ratio. What I have is a Stage which contains things like menu buttons etc, and the rest of the game ...
1
vote
2answers
100 views

LibGDX - Bundling Files

I have 3 files. A JSON file, a PNG file, and a TXT file. Is there any possible way I can put all three inside a common file with a custom extension? (for example "fileName.abc") I searched the web a ...
1
vote
1answer
191 views

Libgdx Box2d RevoluteJoint And Attached Body Interfering With Main Body's Y-axis

I am making a 2d platformer where the character has a melee attack. To achieve this, I created a new arm body which I attached to the player's torso body (comprised of two circles). However, this ...
0
votes
1answer
499 views

Focus scene2d UI actors programmatically in libGDX

I am trying to implement keyboard movement in game main menu which is libGDX Stage with UI-Actors. I'm also trying to code this feature myself since I can't neither ...
1
vote
2answers
849 views

ECS - should everything be a system?

I've just recently started working with LibGDX and Ashley, and I find it to be really useful and I like working with the whole entity/component/system workflow. But I've been starting to layout the ...
0
votes
1answer
130 views

Handling different aspect ratios on a 2D dodging game

I've been making a game where the player is on the ground and has to dodge objects falling to the ground. Since I'm using libGDX (But the question still applies to any other language/framework), The ...
3
votes
1answer
258 views

Libgdx Texture Sides Are Cropped Automatically for Seemingly No Reason

I'm trying to render some textures using libgdx SpriteBatch. This sounds very easy but I have a serious problem. I'm testing on desktop and depending on the resolution of the app window, textures are ...
1
vote
1answer
685 views

LibGDX - Level management on a level-based game

I'm new to LibGDX and android development in general and am trying to do a puzzle game. Being a level-based game, i'm trying to make it so in every level a certain number of blocks (just rectangular ...
1
vote
3answers
290 views

LibGDX - Trying to make a radar-like display

i have an interesting question about geometry. I have two or more moving objects outside of my stage's viewport (blue and red circle in the image below), which i want to point at with two arrows on ...
3
votes
1answer
2k views

How do I implement wander behavior in GDX AI?

So I follow the original gdx-ai documentation and created 2 circles to test Steering behavior. The image shows arrival behaviour but I am still quite lost about how they work. Screen class: ...
0
votes
1answer
2k views

resize images in libgdx

I know how to set Image width and height using pixel coords. Is there a way to set relative coords? I want to deal with multiple screens. For example i have 1920x1080 screen size. And i have relative ...
0
votes
1answer
605 views

switching scenes in libgdx?

I'm writing a little something in libgdx to learn more about the platform. Currently, I have a simple generated world consists of tiles, which are just blocks of texture drawn to the screen. It's a ...

1
2 3 4 5
46