The Stack Overflow podcast is back! Listen to an interview with our new CEO.

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0
votes
1answer
32 views

Can Mobile Games use Fragments instead of SurfaceViews?

All the tutorials of mobile games for android (such as this one), use the to display game objects. Most other applications tend to use an ...
0
votes
0answers
62 views

Is there a way to reference Unity UI object inside native code?

Let's say we have a scene in Unity with canvas and InputField on it. Is there a way i can reference my InputField inside native plugin? Maybe i can pass it from Unity?
1
vote
1answer
188 views

Show/hide soft-keyboard on demand

I'm writing simple chat-app using Unity. The problem with Unity's default implementation of soft-keyboard visibility is that it hides itself when i'm clicking outside of keyboard panel. What i want is ...
0
votes
0answers
25 views

Optimizing large number of ModelRenderable cubes with ARCore?

I am creating an ARCore Android app that involves rendering up to thousands of cubes, of course using a Node and ModelRenderable object for each. Understandably, I'm unable to do that without running ...
0
votes
1answer
49 views

Libgdx - accelerating string displaying

My renderBoard is slow and it's because of font.draw function. I read that I should use stringBuilder instead of string, but it didn't help at all. I suppose I'm using it wrong. Could you guide me to ...
0
votes
0answers
17 views

Android problem with looped background

I'm making some sort of clone for FlappyBird, but with some adjustments. I'm trying to have an animated background running infinitely times. I already have the picture mirrored so the flow will be ...
1
vote
0answers
18 views

Android problem with onTouchEvent

I'm making some sort of clone for FlappyBird, but with some adjustments. I want to change from the FlappyBird's mechaninc of jumping to make the bird raise as long as the player is long-pressing the ...
0
votes
1answer
72 views

How to get collision area within a circle in libgdx

I have a ball inside of a multi-colored circle, the ball will hit the inner area of the circle like this bellow circle image And the Circle will be rotated clockwise or anti-clockwise based on user ...
1
vote
1answer
65 views

Is it always necessary to synchronize rendering in a game loop?

When writing a game loop from scratch in java for an android game applications, it is very common in many tutorials I have read that the keyword synchronized is used to synchronize update and ...
0
votes
1answer
43 views

Trying to understand why libgdx wipes existing models when creating new ones

I'm coding a simulated brain and I'd like to make an arrow appear when one cell connects to another cell. My output without generating an arrow looks like this: Where each block rendered represents ...
0
votes
1answer
90 views

LibGDX: How to make an object falls with random speed

I'm trying to make an object (ball) fall into position Y and when the ball collides with the base. The sprite changes and along with the change I want the speed of the fall to change according to the ...
0
votes
1answer
109 views

How do I implement 3D A* Pathfinding in libgdx?

I am using BDX (Blender with libgdx engine) to create my game. I am not sure on how to implement 3D path finding using A* search. I looked into gdx-ai, but that is for 2D.
0
votes
0answers
34 views

Low fps when drawing semi-transparent color to Canvas (java)

I'm making an Android game and I want to make a darkened background I try to do this with: canvas.drawColor(0x99000000); This works but my framerate drops from a ...
0
votes
1answer
49 views

Which part of the frustum sits at the eye position?

In Java I create a frustum projection matrix via Matrix.frustumM(projMatrix, 0, left, right, bottom top, near, far); and a view matrix via ...
1
vote
1answer
211 views

Draw line between tiles of tiled map in libgdx

I want to draw line between two tile of my .tmx map in libgdx . I want to get a tile position but not in pixels , in maps grid numbers like : (0 , 6 ). or is there any way to change a tile color in ...
1
vote
1answer
134 views

How to create an even gamescore?

Currently I'm doing an android game. My problem is the score. The game speeds up in every round and currently I'm counting the score like this: ...
0
votes
0answers
96 views

How can I use the NDK to make games?

I want to use NDK to use my existing C++ code for a game. I know there are two ways to use NDK: I can use Java to create GLSurface and opengl context; I can use NativeActivity class to entirely write ...
0
votes
1answer
63 views

How can I speed up the shapes drawing on high-density devices?

I have a game that should draw many shapes on the canvas and in every frame these shapes position will change, the game is running smooth but after adding more shapes some jerk arise and it drops some ...
-1
votes
1answer
117 views

Java 2d array to generate grid - java.lang.ArrayIndexOutOfBoundsException: length=4; index=-1

I am creating a Hashi Puzzle game (Islands and Bridges) I am generating a 2d grid with Islands that can be connected using bridges, I am also running a DFS algorithm to check if the map is solvable I ...
0
votes
1answer
73 views

Open world game state saving Android

As a hobby project I'm building a 2D game with a custom game engine in Android. Currently I can render a json map, and let the user interact with objects on the map. The game should be an open world ...
3
votes
2answers
343 views

How to make the camera follow the player in Libgdx?

In Play class I have the viewport of game height=320 and game width=240unitswith camera cam. I have set the camera(cam) viewport width to 10 and viewport height to 7.I have another camera hud whose ...
1
vote
1answer
139 views

How to insert animation into table?

I'm having trouble inserting animation into my libGDX table cell. I have a class which holds 2 tables, one on the left and one on the right. First table is for labels/buttons/other stuff. Second table ...
0
votes
0answers
607 views

Use ARCore to detect marker and show information

I'm new to AR, and am trying to use Google's ARCore to build a simple AR prototype. Basically if a logo is detected, I like to place some real-time charts or text information on the screen. Similar to ...
0
votes
1answer
108 views

adding virtual-joystick relative layout to a surfaceview in Android

The problem: I have my main class which extends surfaceview that contains the gameloop and I want it to use the virtual joystick found here (https://github.com/controlwear/virtual-joystick-demo) but I ...
1
vote
0answers
395 views

LibGDX background image not fitting the whole screen

I'm trying to add a background image to the game's main menu, and when I execute the game as a Desktop Application it fits OK, but if I execute it on a movile device (or using a virtual device) it ...
1
vote
0answers
286 views

How to approach debugging of java.lang.NullPointerException in android build of unity app?

We are getting an obscure java.lang.NullPointerException when building a Unity app for android. There's not much information here that I can trace back to our code. Does anyone have advice about how ...
0
votes
1answer
137 views

Libgdx can't read .ttf file when running Android configuration

Firstly, I am aware that a similar question was asked some time ago that went unanswered. Currently, it has multiple upvotes but no answer. The error ...
1
vote
1answer
116 views

What do I do with a libgdx rectangle collision?

The edge of the rectangle is not detached But if the rectangle is narrowed, it will affect the left and right collision detection
-1
votes
2answers
632 views

Error with LibGDX on Android Studio : Exception in thread “LWJGL Application” java.lang.NullPointerException

After a long time of research, I saw that in January 2017, NVIDIA put a new driver that made crash every application running with LibGDX. I would like to create a game with this library on Android ...
1
vote
1answer
160 views

Steelseries Stratus XL controller: Keycode for middle button

I'm working on an Android app (Java, level 19+) that uses a controller to e.g. walk and it's working (almost) fine with both the Steelseries Stratus XL and the Moga Pro Power. The only problem is that ...
0
votes
1answer
36 views

Data not showing properly as per my field in the game

I made the game in android in this game i want first login and registration through JSON object. I have a API link where JSON Object send data from that url to the server but in my server i get the ...
0
votes
1answer
60 views

Problem getting in adjust the image in drawable canvas

I am working on the game which i develop on android and i am just stuck on adjust the images. I want the spinning ball image in center where i targeted the red color on the given image and the both ...
1
vote
1answer
378 views

Unable to get Box2dlights to cast shadows

I'm trying to use box2dlights to add lighting to my game and I have everything working except I am unable to have shadows cast with my box2d bodies. I also have collision working using category/...
1
vote
1answer
347 views

Libgdx Texture change

I have been working for several days to try and figure out how to change a texture whenever a scene2d Table is clicked in libgdx, I am using pixmaps to dynamically change the textures colors instead ...
0
votes
1answer
107 views

How to store the updated score in mysql databse from android?

I want to store the updated score in mysql database. So, what i do for that? ...
5
votes
1answer
409 views

How can I make the main game loop frame-rate independant?

I am trying to create a frame independent game loop. I am currently using the following code ...
0
votes
1answer
270 views

How to restart game when player lose?

am making a simple in which you drag a player on screen and when a ball hits you you lose ,so you have to move the player away from the balls.level zero:no balls, level one:there is one ball on screen,...
1
vote
0answers
178 views

How to integrate android camera for LibGDX project? (deprecated material..)

I'm trying to use the Android camera in LibGDX. I tried using this implementation of the API, which is basically the only you will find on Google. https://github.com/libgdx/libgdx/wiki/Integrating-...
2
votes
1answer
98 views

Similarities and Differences between LWJGL and Android OpenGL?

So, since I’ve been working a lot with LWJGL recently, I’ve come to learn that Android has native OpenGL support. So, what does this mean for me? Is OpenGL handled the same way it is in LWJGL? What’re ...
3
votes
1answer
95 views

How to find the ideal path done inside a given shape in LibGDX?

I'm trying to make an android/libgdx game in which for every level you have a different shape as a png, and you have to drag your finger inside the shape and try to be as close as the ideal path ...
3
votes
1answer
587 views

how to slide pieces for a slide puzzle game for android(libgdx)

I want to make a small one-screen game in which the player has to slide pieces of an image until the image is completed. I used texture regions to create the pieces from an image ...
1
vote
0answers
50 views

Android Game Screen Limits [closed]

I'm trying to do a game but I'm stuck. I have a player and I move it with the buttons but I can't make the player stop when it reachs the screen limits. What am I doing wrong? Main Activity: ...
1
vote
1answer
189 views

Check if rectangle sides overlap each other in 2d

I am drawing a rectangle. On touching the corners, I am able to resize this rectangle. Now, the issue is during resizing, opposite sides overlap and cross each other. I have to stop this overlapping ...
1
vote
0answers
48 views

Why is my stage input processor working on the desktop but not on an Android device?

In my project, I have a button in my stage with a listener. The problem is that the listener method changed is fired when running the game in desktop but it is not fired when running the game on an ...
0
votes
1answer
266 views

How do I make so the player jump happens only once in a onScreenController on LIBGDX and the player doesn't stick on the roof?

I'm making a simple platform game, and I was following this tutorial to make an onScreenController (https://www.youtube.com/watch?v=z4Vqkp_ve3I&t=66s). There's one think that's not how I want it ...
0
votes
1answer
834 views

Can this singleton class cause a memory leak?

In a game I'm writing using LibGdx, I'm wondering if a memory leak will occur on Android when the home key is pressed or a phone call gets received and the game gets put into pause. I have a ...
0
votes
1answer
219 views

LIBGDX - How do I change the loaded file by the TmxMapLoader from class that extends from the playscreen screen?

So I was following this guy's tutorial on how to create the Super Mario Bros game, and I was wondering how it would be possible to change levels (screens), in the tutorial he creates a PlayScreen, I ...
0
votes
1answer
387 views

Why does my libGDX TextureRegion.split code not work properly?

I am using scene2d in libGDX on Android as part of a game I am working on. I have a simple splash screen, which I am trying to display a single image on. The image comes from a file with two tiles in ...
1
vote
1answer
3k views

How to draw smooth moving curve in libgdx?

i need to draw curve like this picture, I have tried from this link https://github.com/libgdx/libgdx/wiki/Path-interface-&-Splines , but the curve is not so smooth like some game(Amazing Wire) ...
0
votes
1answer
482 views

Problem in bounding box collision detection in libGDX

I have a Background class containing 5 layers, I've created a collision box for 5th layer. Here is the code for my Background class: ...