1
vote
0answers
25 views

Yet another libGDX resolution independance question

I am developping a Android smartphone game in LibGDX, and I am encountering issues about resolution managing. Most notably, I have no clue how to handle that in LibGDX. For now, I am developping ...
0
votes
0answers
14 views

Google Play Game Services - Handling messages via p2p, host or no host?

I am developing a real time multiplayer game using Google Play Game Services. The underlying networking is done via P2P. Everything I read says I should still have a game host that sends out all the ...
0
votes
0answers
20 views

Multiple time initialize same texture

I am newbie to libgdx gaming, i have a problem to initialize the multiple images having same texture;try to do using array and i could not do,as i am very new so can help me sort out. private Image ...
0
votes
1answer
49 views

The sprite will not move in libGDX

When I ran the android application, The sprite image will not move when I press the input keys. I followed a tutorial based on input keys and wish to know what's wrong. Can anyone see what's wrong? ...
3
votes
2answers
100 views

Why are my Box2D wheels slipping on ground?

I have a car, set up in Box2D as a rectangle connected with two wheels using WheelJoints: The wheels are defined as follows: FixtureDef wheelFixtureDef = new FixtureDef(); ...
0
votes
1answer
53 views

If filled polygon cannot be drawn via libgdx ShapeRenderer , then what is the work around?

I know most of you would suggest me to draw a filled polygon by using combination of triangles and rectangles , but that is not possible for complex shapes . I want to basically draw a generic shape ...
2
votes
1answer
67 views

How can I use imprecise accelerometer data for controls?

I want to rotate an object with respect to the phone's position. I use the accelerometer output to detect orientation: float roll = Gdx.input.getRoll(); float pitch = Gdx.input.getPitch(); float ...
0
votes
1answer
46 views

Does LibGDX abstract OpenGL ES away or can I still use my OpenGL ES knowledge?

I've been learning OpenGL ES, and am now turning my attention to using LibGDX. My main concern with LibGDX is, if needed, will I be able to apply my OpenGL ES knowledge to something if needed and ...
1
vote
1answer
55 views

Touchable Hud with Actors in Libgdx

I am writing a Tower Defense for Android. Right now my LevelScreen contains a Background-Actor which is pan-able and some zones to buy Towers - after buying them you can upgrade them further. When you ...
1
vote
1answer
98 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 ...
0
votes
0answers
48 views

How to open another class by clicking on a button on libgdx?

I have a question about libGdx. I am making my own game, I have already made a splash screen and a main menu. I have made a button "Play" in my menu but I can't link it to my main game. however, I can ...
1
vote
1answer
96 views

How to make an Actor follow my finger

I'm back with another question that may be really simple. I've a texture drawn on my spritebatch and I'm making it move up or down (y-axis only) with Libgdx's Input Handler: touchDown and touchUp. ...
1
vote
2answers
107 views

How to render rounded shape perfectly?

I'm having issues rendering rounded shape figures. I have a Texture with different images in it and I get this whale figure from it with TextureRegion but the stroke of it looks pixelated. The ...
1
vote
1answer
79 views

Why isn't my background drawing to the screen?

Ok, So I have a game I have been working on for a few months now and I am now stumped beyond belief. My friend who has spent days working on this background gave it to me and I put it in my game. On ...
2
votes
1answer
111 views

LibGDX collision detection on moving and rotating object (rectangle enemy) [closed]

i am trying to get collision dectection working properly but when i do it, the collision area keeps moving. no matter what i tried. there are 2 objects and the objects are moving and i cannot get the ...
1
vote
1answer
83 views

Multiple enemy array in LibGDX

I am trying to make a multiple enemy array, where every 30 secods a new bullet comes from a random point. And if the bullet is clicked it should disapear and a pop like an explosion should appear. And ...
0
votes
2answers
83 views

Make objects slide across the screen in random positions

I want to make an object appear randomly at the right hand side of the screen and then slide across the screen and disapear at the left hand side. I am working with libgdx. I have this bit of code but ...
2
votes
1answer
64 views

libgdx arrays onTouch() method and delays for objects

i am trying to create random bullets but it is not working for some reason. also how can i make a delay so the bullets come every 30 seconds or 1 minute???? also the onTouch method does not work and ...
2
votes
1answer
82 views

libgdx collision detection / bounding the object

i am trying to get collision detection so i am drawing a red rectangle to see if it is working, and when i do the code below in the update method. to check if it is going to work. the position is not ...
1
vote
1answer
48 views

LibGDX onTouch() method Array and flip method

How can I add this on my application. i want to use the onTouch() method from the implementation of the InputProcessor to kill the enemies on screen. how do i do that? do i have to do anything to the ...
1
vote
1answer
53 views

libgdx draw issue and animation

it seems as though i cannot get the draw method to work??? it seems as though the bullet.draw(batcher) does not work and i cannot understand why as the bullet is a sprite. i have made a Sprite[] and ...
0
votes
2answers
80 views

libgdx - handling battery warning

I want to pause my game when the battery warning on Android pops up. How do I do this? I have a method that pauses the game but how do I call it when the battery warning pops up?
0
votes
1answer
197 views

LibGdx efficient data saving/loading?

Currently, my LibGDX game consists of a 512 x 512 map of Tiles and entities such as players and monsters. I am wondering how to efficiently save and load the data of my levels. At the moment I am ...
0
votes
1answer
153 views

Cover Screen with Snowing Effect in Libgdx

Oddly enough I cant find clear instructions on this theme (I only found rain and the method is very particular) so I ask, how do I implement a whole-screen snow-falling effect? The methods i can ...
1
vote
1answer
190 views

Android LibGDX game: Choosing starting activity

I am making a Android game with LibGDX (using ADT eclipse bundle). How do I choose the default activity to launch when the user opens the app. I set the project up with the LibGDX setup GUI, and I ...
2
votes
2answers
127 views

how do I create a moving type of block like in Mario[box2d]

I want to create a block which only moves up and only when hit from below. I am trying out a distance joint and I read it can be used as a spring, is this the correct solution? the way I have tried ...
-1
votes
1answer
52 views

Game slow with older phone [closed]

I've made a game using libgdx. On m'y HTC One X, the game works good, even if there are some lags but only at the beginning. I wanted to try it on an older phone (well a less powerfull phone), a ...
2
votes
2answers
183 views

How do I make a puzzle piece move smoothly between locations?

I'm building a 2048 clone to sharpen my Libgdx skills, but I don't know how to ease a tiles between board locations. When I slide my finger, the tile moves rather swiftly. How I can make the movement ...
-1
votes
2answers
79 views

How to implement “move to touch location” function?

What is the formula/logic to implement moving an object towards a TOUCHED location. I want character A to move to my finger and it must be accurate. Here is what I have tried so far: @Override ...
0
votes
1answer
88 views

Parse and iterate over SVG path

I need to parse a SVG path expression like m8,295c-4,-292 441,-291 446,-26c5,265 440,263 442,-9 and have a way of iterating over it in [0 ... 1]. I looked into Apache Batik but it doesn't seem to ...
0
votes
1answer
67 views

my movement is working good on keyboard but on android its not

So basically here is what my movement is like for keys: key down if (keycode == Keys.LEFT) { mishi.getAcceleration().x = -13; } key up if (keycode == Keys.LEFT) { ...
0
votes
1answer
110 views

Two issues with testing LibGDX on Android

1) When I test my game on desktop it is 100% fine. When I test it on my Nexus 7 physical device, it is the same except the backgrounds have no color. For example my splash screen has a greenish ...
0
votes
2answers
263 views

Publish android game only for 800 x 480 resolution in portrait mode

I have developed a game in libgdx. I worked for long and after finishing I found that the game runs perfectly on devices with resolution 800 x 480. I found this solution ...
0
votes
0answers
53 views

Swing and LwjglAWTCanvas

I use LwjglAWTCanvas in my jFrame. I want to load textures on some swing event(I did it from postRunnable in order to get OpenGL contex). final LwjglAWTCanvas hexagonEditorCanvas = new ...
1
vote
0answers
261 views

Resize the Texture Region (parallax background) to fit my screen size in libgdx

I am using libgdx to make a running game. I am using vertical parallax background. I have successfully implemented parallax background many times. But for this game, I want my Texture region to fit my ...
0
votes
1answer
111 views

Libgdx. Converting Screen Click Coordinates into World Coordinates for 2D Game

I'm using the InputHandler's touchdown method. It gives me my screenX and screenY. Is there a simple way to convert screenX and screenY to world coordinates? By my understanding, InputHandler returns ...
0
votes
0answers
56 views

Slowdown in sliding background with Libgdx

I´m new with libgx and i have a basic question. I want an background like an image that repeats indefinetely, and moves down. I did with 2 images and it worked, but the problem is that is very slow. I ...
1
vote
1answer
85 views

How to poll input for a gui in libgdx?

Ok, so my question is simple. How do you poll input with a GUI class without it affecting what's underneath the GUI? So suppose you have an RPG game with a gui for the d-pad and other controls: ...
4
votes
1answer
471 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 ...
0
votes
1answer
379 views

LibGDX cannot save to internal file

I want to save the state of the game in a file, so I can read it at the next start. The Problem is, that I get a exception, if I try to save something internal. If I try to save it local all work ...
1
vote
2answers
69 views

How do I inline images between text in a Table?

I have a Table and a Label with wrapped text. I want to display some images in-line with the text. For example: This is an image -IMAGE_HERE-, and now some more text showing, yet, another image ...
1
vote
0answers
196 views

How can I transform a group of objects in libGDX?

I'm new in LibGDX. I created group with actors in show method and add listener (where i calculate rotation matrix) and want to rotate all actors from group with ...
11
votes
2answers
2k 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 ...
0
votes
1answer
43 views

Actors (Label) not being drawn to stage [closed]

I have a weird issue that when I try to draw a Stage with only an Actor, a Label to be more precise, added to it and nothing seems to be getting drawn. This is how my setup goes: I have a Sprite ...
1
vote
1answer
153 views

Change game from portrait to landscape dynamically

I have multiple classes that implement Screen. I want to, say, have the Main Menu screen portrait, then the Play Screen landscape. Is there anyway of changing the orientation dynamically? I thought ...
0
votes
2answers
3k views

How do I make a background fill the whole screen in Libgdx?

I'm using this code to set a 800x420 image to be full screen: public void show() { float w = Gdx.graphics.getWidth(); float h = Gdx.graphics.getHeight(); camera = new ...
0
votes
0answers
135 views

glsl fragment shader work diffrently on different devices

i'm making a 2d android game where i have a mechanics that allow the player to move the camera away from the main character, and to not allow him to explore the hole world, a have create a Fog shader, ...
0
votes
3answers
522 views

LibGDX Android version

I am trying to use the LibGDX UI Project creator to create LibGDX projects, but it doesn't allow me to choose the Andorid version for the project. This is a problem for some android features. For ...
0
votes
1answer
591 views

LibGdx Android Phone Resolution problem

I am using the LibGdx framework and have an issue. Currently, I am creating a game in a resolution of 480 x 320 and using 'GL20' to remove the restriction of that dreaded 'power of two' error. It ...
2
votes
2answers
143 views

How do I create a horizontally centered “gravity line”?

Here's my ideal scenario: A game object (in blue) can change its horizontal velocity, but it will be pulled back by gravity (dotted gray arrows) toward a central vertical line (in red). How can I ...