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.

learn more… | top users | synonyms

0
votes
0answers
9 views

How to avoid position increment by velocity multiplied by delta time even the body is not moving?

In the below image, the character texture is properly sync to body even moving on free space. In the below image, the character is moving downward. But the texture got a span or not sync properly, ...
0
votes
0answers
18 views

Should I use finite state machine with entity component system? [on hold]

In the below code, is the components that is required to have a state. AnimationComponent MovementComponent AIComponent Where I'm at now: I've create a different State and Handle it using fsm or ...
0
votes
1answer
39 views

Grid-based smooth lighting

I implemented basic lighting in my game and I want to turn it into smooth lighting (like this). I'm currently tinting the tiles based on their light level and I have no problem changing it. My current ...
2
votes
1answer
20 views

Handling data logic on libgdx ai state machine or in ashley system?

In this below example, I've combined libgdx ashley and AI state machine. Do you think it's a good idea to handle the logic in state machine or stick on handling the data logic on System? public enum ...
0
votes
0answers
12 views

What tools and formats are used to express motion graphics animation [on hold]

I'm developing a game application, I want to dwell on object motion designing in the menu scene in my game. Currently menu icons just fade-in with linear alpha value increasing, which I hard-coded. ...
1
vote
0answers
18 views

Why it takes some time to update the sprite draw order in libgdx SortedIteratingSystem?

I have a rendering system that extends SortedIteratingSystem and created a comparator to sort the sprite draw order. But the problem is when I update the z index, it takes some time before it changes ...
1
vote
1answer
22 views

How to draw the imagebutton and place it in the lower left corner

I have the button: soundBtnStyle = new ImageButton.ImageButtonStyle(); soundBtnStyle.up = skinBac.getDrawable("on");// soundBtnStyle.down = skinBac.getDrawable("off"); // soundsButton = ...
1
vote
2answers
23 views

How to handle Tilled Map z index order with player in libgdx?

The below 1st image is the example how I render tiled map with player, I can properly change the player z index, If I want to make the player below the box i just set the z index to 0. But the problem ...
1
vote
0answers
17 views

LibGDX: I need to get from SpriteBatch to Batch in order to draw a Touchpad

I have created a little game using LibGDX and it uses a SpriteBatch when it renders the game objects. Now I want to add a Touchpad to it, and the draw method of Touchpad takes a Batch as a parameter, ...
1
vote
1answer
13 views

PlayerCenteredScores in LeaderBoards

Games.Leaderboards.loadPlayerCenteredScores(mGoogleApiClient,leaderboardId, LeaderboardVariant.TIME_SPAN_ALL_TIME, LeaderboardVariant.COLLECTION_PUBLIC, 5).setResultCallback(new ResultCallback<...
0
votes
0answers
11 views

Chartboost ads not showing on some Android Devices [on hold]

I had implemented chartboots ads in my Libgdx game. When I tested it, it worked properly and when I published the game it is working well on some devices, but it doesn't work on others. my friends ...
1
vote
0answers
18 views

Linking 3D Models together in libgdx (skeletal)

I'm drawing a 3D stick figure for an Android app using Libgdx and its ModelBuilder's createCylinder() and createBox() methods. In the render method I animate it by applying translations and rotations ...
0
votes
3answers
72 views

Difference Between LibGDX and LWGJL

I've been looking into developing a small game with Java, as I am fairly familiar with it and see game development as good opportunity to improve my knowledge. When I research different libraries and ...
0
votes
1answer
19 views

Transition the scale of a sprite

I'm new to this engine but I am making a menu with some basic animation, I would like to start with a sprite scaled up and then it would transition to the normal size. Is it possible with LibGDX or do ...
1
vote
0answers
20 views

How do I pool a bullet in libgdx ashley ECS approach?

I'm having problem creating bullet pool in ashley ECS approach, because i'm using PooledEngine, everything is pooled. So I've done is I just use engine.createEntity(), engine.addEntity() and engine....
0
votes
0answers
43 views

Algorithm for 2d AI aiming to compensate for gravity

In a 2d side-view scenario I have two riflemen aiming at each other. By normalizing the x and y difference they know the direct path to the enemy. However, gravity will pull the projectiles downwards,...
1
vote
0answers
10 views

Libgdx Error in Importing chartboost. sdk

I am trying to add chartboost ads, I had added the jar file to my libs but when I am trying to import the chartboost sdk it gives me error and the whole lines of: import com.chartboost.sdk.Chartboost;...
1
vote
2answers
41 views

How to use GdxAI with libgdx ashley ecs framework?

I'm planning to use GdxAI Telegraph in GdxAshley ecs framework, my problem is how I'm gonna create a telegraph component if I wanted to dispatch a message? I have created AIComponent and AISystem. ...
1
vote
1answer
70 views

Can't load png in texture

I created new project in libgdx without Android, specified for Eclipse. I added testcar.png to assests in core project, refreshed core and desktop projects, new Texture(Gdx.files.absolute("C:\\...
1
vote
0answers
22 views

What is the proper way of creating bullet in libgdx ashley ecs framework?

I'm still thinking, how do I properly pool a bullet in libgdx ashley? Because the PooledEngine is available, which the Entities, Components and Systems are already Pooled. I made this below example, ...
2
votes
2answers
71 views

How to pool child classes in LibGDX?

I have a super class named Monster which implements Poolable. Then I got child classes which extends from the Monster class, but I can not figure out how I will use pool and maintain only one set of ...
0
votes
1answer
22 views

Turning x and y difference between two points into a projectile moving between them at a fixed speed

In a libgdx project of mine, I have two units on a 2d field who want to fire at each other. They both know the x and y distance to each other by subtracting their enemies position from their own: ...
1
vote
1answer
48 views

How to minimize the repetitive creation of component in libgdx ashley?

The below example is creation of character Entity. My problem is do I always need to call these engine.createComponent(...class) to create a component? Or should I wrap these to another class that ...
1
vote
1answer
50 views

Scene Transition in libgdx

How can I make transition between stages in libgdx ? I have 2 screens MenuScreen and GameScreen each of which has a stage I write the following to make a transition : in MenuScreen SequenceAction ...
1
vote
1answer
59 views

How do I use Sprite in libgdx ashley ecs framework?

In the libgdx ashley wiki there's an example of Position and Velocity components, which is pretty easy to understand. My problem now is I don't know how do I integrate Sprite class as Component. In ...
1
vote
1answer
29 views

How to wrap ECS components to OOP in libgdx ashley?

Currently I am using builder-pattern to create my Entities PooledEngine engine = new PooledEngine(); ... CharacterComponent character = engine.createComponent(CharacterComponent.class); ...
1
vote
1answer
104 views

Libgdx how to draw name above monsters head

As you see, the player hud works perfect, but when i move the monster name moves with me. Instead to get attached to the monster. Player has a hud and i'm using Scene2D.ui to pull it off and works ...
0
votes
0answers
21 views

Rendering Map at point

I am trying to have the map display over the background image of my play screen and I cant find a way to have it appear to the side. I would like it to appear where it is in the example i made in ...
1
vote
0answers
25 views

Displaying an image when ScrollPane item is highlighted

I would like to have images displayed when an item in the list is highlighted as a form of a "preview" of the map that is selected. I'm not sure how i would implement this with clickListeners or ...
1
vote
0answers
11 views

LibGDX Compare color of Box2D objects on collision

I have two red balls and two yellow balls, which were created from a class Ball. The balls are box2d circles, with sprites attached. Is there a way in which I can check to see if two balls have ...
1
vote
0answers
24 views

Test for Box2D collisions between object being dragged and other objects

Goal: I am writing a prototype which has as many as 50 (Box2D) colored balls on the screen. I can drag any ball, and what I need to do is test whether the dragging ball has touched a ball of the same ...
3
votes
0answers
19 views

LibGDX: Shader files in assets - Access is Denied

I stored the glsl files in android -> assets -> shaders directory, but when I run the app, an error is displayed: Error:Gradle: Execution failed for task ':android:mergeDebugAssets'. Error: ...
1
vote
1answer
34 views

Change the alpha blending color of scaled textures

It looks like semitransparent pixels are blended with while color when textures are drawn scaled. It is very noticeable and looks ugly when textures are drawn on dark background. public class ...
-2
votes
1answer
36 views

Polygon movement towards certain point libGDX

I recently started using the Polygons but I'm have struggle as I'm trying to make a Polygon move towards the center of my screen, although I don't know how. Here's the code I have(What I'm trying to ...
1
vote
1answer
19 views

click event not registered for an actor inside stacked cell within a table in libgdx

In the following code segment, the click event for image element is not registered. However, if i comment out stack.add(shapeLabel) statement, then the image button is able to register the click event....
1
vote
1answer
24 views

Unable to remove class information in serialized json file using libgdx

I am encountering a problem in serializing an array of objects to json file. Please let me know where I'm making the mistake. Object to be serialized : package components; public class UserGameInfo ...
0
votes
0answers
42 views

Sprites Positons

I create my sprites for 800x480 and position them accroding to this On dealing with multiple resolutions I use a method that set sprite size and position according to the current resolution instead ...
1
vote
1answer
50 views

Explosion animation only rendering last frame

I recently picked up libgdx and I'm obsessed. So far it's been smooth sailing until I've tried to implement an explosion animation based on an event. The game I'm developing is a simple space asteroid ...
0
votes
1answer
22 views

LibGDX Image Outline Help

As I was working on some art for my project, I decided that I should add an outline around some objects. So I tried my method; which was to create a second image slightly larger than the first, make ...
2
votes
2answers
48 views

Isometric map black screen

I am trying to create an isometric map and I am very new to it. Please see the attached example map. While rendering it I've noticed that when my actor reaches the edges of the map the player can see ...
1
vote
1answer
33 views

Libgdx How to overlay two images on Table

I'm trying to set the player image inside the circle of the bars. I've tried to use stack, to position it topLeft but it does not work. Stack stack = new Stack(); healthbar = new Image(new ...
0
votes
1answer
29 views

libgdx - Should I use OOP in ECS framework? [closed]

For example I have OOP class of Bullet and I have created the pool and factory. Should I convert it to componet based? Like BulletComponent, then handle by BulletSystem? by the way I'm using Ashley ...
3
votes
0answers
18 views

Tile Texture If Dimensions of Sprite Are Larger Than Texture

I have a sprite that acts as a wall in a game that I am building. I would like to have the brick texture repeat itself instead of stretch to fit the height of the screen. I tried: Texture ...
3
votes
1answer
64 views

Why does every texture drawn cause a new draw call?

I'm currently working on a 2d sandbox tile game in LibGDX and I noticed I had 700+ draw calls. So checked my code and I could not find anything that would cause a new draw call. All the tiles are ...
0
votes
2answers
37 views

How would I make my position interpolation stop once the destination is reached?

I would like to implement tile-based grid movement and I've heard that linear interpolation comes handy in the implementation process. I've tried to use it but I'm not sure how to make it stop once ...
0
votes
1answer
21 views

LibGDX - blurred textures when resizing

Hi could anyone help me solving the problem of blurred texures? My viewport screen have 800px of height and 480-600px (for different aspect ratios) of width and when I test game on smartphone with ...
1
vote
0answers
33 views

Libgdx final stage of adding admob to game

I had finished my game and wanted to add Admob ads to the game. I followed all the instructions in Admob in Libgdx and It's working very well, and the ads are shown properly, I just wanna be sure ...
0
votes
0answers
20 views

make scrollable list in circular shape using libgdx

I am developing a game using libgdx. I am stuck at making a list in the shape of a half circular which is also scrollable. This is a sample image (not circular) which I want to be in similar shape ...
0
votes
0answers
26 views

Uniform Interpolation?

In currently developing a little local Multiplayer game. In using Interpolation to make the player and entitys move smoothly but there's one problem, im using Interpolation, that looks like this ...
0
votes
0answers
35 views

LibGDX - Parallax scrolling background help

I've been trying to do a parallax scrolling effect on my 2D side-scroller game, to give the illusion of depth, by having layers at different speeds. Basically, I have a camera that follows the player....