Questions tagged [libgdx]

1

votes
1

answer
38

Views

Java: Why can't I properly render colours (RGBA) with LibGdx?

When I change the colours to blue Gdx.glClearColor(0,0,255,1) then it works as it should. But when I use Gdx.glClearColor(51,204,255,1)the colour remains white. What do I have to change to make it work? @Override public void render(float delta) { Gdx.gl.glClearColor(51,204,255,1); // this makes the...
NotEinstein
1

votes
1

answer
248

Views

LibGDX optimize way to draw background with large resolution

I have a problem that has been torturing me for a month, and maybe more. There is a large background of about 9000x13000 pixels. And I am trying to bring this background to the screen. Since my video card only supports textures with a resolution of not more than 8192x8192 pixels, a black area is dis...
Ryder95
1

votes
1

answer
165

Views

Need help scaling screen in LibGDX/Box2d

I've been creating a simple game for android/desktop using the libGDX framework. It's about done, but I've had a lot of trouble getting it to scale to different screen ratios. I am currently using a FitViewport, which works fine for keeping my desired screen ratio, but I'd like to make it so that th...
Dayne Kramer
1

votes
1

answer
45

Views

Libgdx Parse Error

I'm working on a LibGdx project, Demo and copied some code from another LibGDX project folder, MarioBros. Now, after running the code, the program throws an error saying ParseError, cannot parse file MarioBros/core/assets/untitled.tsx Any fix guys? Why is my Demo project finding files in another pro...
Hussain Arif
1

votes
0

answer
87

Views

something wrong with table in libgdx

package Controller; import Play.Play; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.physics.box2d.World; import com.badlogic.gdx.scenes.scene2d.InputEvent; impo...
Grinning Trout
1

votes
1

answer
62

Views

gdx-pay amazon integration

I'm trying to implement gdx-pay for Amazon, but I can't find any info for that. First problem is when I try to register receiver on manifest fileI get this error : Unresolved class 'ResponseReceiver' here is my full code: In my gradle file I use this dependencies : Configure dependencies using Grad...
Jovan
1

votes
0

answer
139

Views

how to get layer from the map in libgdx (TiledMapTileLayer)

Map map; public void Create(){ map=new TmxMapLoader().load('map.tmx'); } public TiledMapTileLayer.Cell remove(){ TiledMapTileLayer tileid = (TiledMapTileLayer) map.getLayers().get(2); return tileid.getCell((int)(body.getPosition().x*100/16),(int)((body.getPosition().y*100/16))); } i want to get l...
Grinning Trout
1

votes
1

answer
237

Views

Mockito + PowerMock + TestNG + Libgdx

I'm trying add the powermock library to the working project, but I'm getting errors. How I add it: 1) AbsTest extends PowerMockTestCase 2) Build.gradle dependencies 3) In some test add @PrepareForTest({SomeClass.class}). After this step this error occured. In build.gradle all libraries are included....
CoolONE
1

votes
1

answer
74

Views

Tween to create the effect of one object follows another-LibGdx

I have a object(named frame) on screen,it will move either left or right according to where I move my finger. public void handleSwipeInput() { if (MyInputProcessor.isTouchDown) { float movedir = MyInputProcessor.dist > 0 ? 1 : -1; float speed = 30; float actualSpeed = Math.abs(MyInputProcessor.dist...
Niranjana
1

votes
1

answer
218

Views

HTTP Request Handler Connection Reset Error

I am writing up a simple HTTP request handler, but kept randomly encountering Connection Reset errors while transmitting files over to the client browser. Since my program is rather large, I will simplify the codes a bit below: public class HTTPRequestHandler implements Runnable { private Queue requ...
Ice Drake
1

votes
1

answer
46

Views

Android app(java): can't read a file and no error message appears

My problem might not be exactly that I can´t read a file but a class that should recieve the info of that file doesn't have that info. I am trying to make a game with libGdx using tile maps. I wanted to create a custom tile map that used 4 ArrayList (one for each quadrant) in order to create a base...
Matheus Bento
1

votes
1

answer
147

Views

Hovering over text not changing colour - libgdx

I am trying to change the colour of my font to white when I hover over it so that it is clear for the user to click that particular button to proceed. However, I am confused as to why it is not coming up as white and instead is staying as the colour it already is. I'm using Hiero to get my font. i...
Dude
1

votes
0

answer
95

Views

Can't install libGDX

I am trying to install LibGDX for java. I have been searching for 2 two days but didn't find anything yet. (I am a newbie so I was thinking maybe I can improve myself with this library) Really need help here. FAILURE: Build failed with an exception. *What went wrong: A problem occurred configuring r...
drh0use
1

votes
1

answer
180

Views

libGDX Cannot read file from Gdx.files.internal

I have a bit of a problem with my libGDX project. In class(high school, don't think of too much), we have to make a hangman game. With some of my friends, we started to make it in Scala. Well, it works, kind of. But the problem is that I cannot read the files from which the words are generated. It's...
BODAND
1

votes
1

answer
772

Views

2d isometric maps in libGDX

Im a starting game developer and I'm having some issues with how to setup a isometric 2D map. I haven't got the slightest clue in how I should accomplish that. And what would be the easiest way to do this. EDIT: I already have looked up tutorials but they are mostly to make 3D isometric maps. Thanks...
Shawn Gyina
1

votes
0

answer
30

Views

Bitmapfont on stage

I have a stage and It has a rectangular image which covers the half of screen. I put a bitmapfont which shows 'Highscore: ' but when I add this font to the stage, the font stays behind the image and hard to see... I want it to come in front of that image but how can I do it ?
berke
1

votes
0

answer
43

Views

LibGDX actor registers mouse clicks in wrong places

I got a screen with a stage. I add UIGroup (which draws all the ui elements) and BattleSceneGroup (which draws all the actors needed for the battle) to the stage. Since I am using one stage for both of those groups, the y = 0 coordinate for my BattleSceneGroup starts at y = 230 , because UIGroup whi...
Jaroslav Gorshkov
1

votes
1

answer
42

Views

Stage does not change to another

I have 2 stage which named 'stagemain' and 'stage' and gamescreen in my programme, first stagemain comes and I click 'new game', and game starts. Character dies and stage comes. In that 2nd stage, there is a homebutton image. I added it clickListener, so it leads to 1st screen(stagemain)... But I fa...
1

votes
0

answer
72

Views

Libgdx crash on Android when opened from lock screen notification

I have a bit of a rare case here which I have been trying to figure out for days and officially lost. Basically, we have OneSignal integrated in our libgdx app for push notifications, and have discovered that if the app is in the background, and the notification is tapped from the lock screen, the a...
hamham
1

votes
0

answer
51

Views

Box2d Lighting different behavior with different screen size

I tried to play a little with lighting, but very quickly I came upon weird behavior that I dont understand. Could anybody explain to me, why this happens, if it is on purpose, or I do something wrong. On the first image, light goes little trough obstacle (which is also weird). When the screen size i...
Gobanit
1

votes
1

answer
34

Views

Jump speed increasing I don't know why Libgdx

I'm creating a 2D game. I have a character which can move LEFT, RIGHT and JUMP. But every jump is faster and I donat know why. When I start the game first, the jump is OK. But every next jump is faster. I think something is increasing the speed but I don't know what. Can someone look into my code?...
K4mczi
1

votes
0

answer
66

Views

[Java][Libgdx] Isometric Tilemap Scaling and Coordinate Conversion

I have a 15x15 Isometric Tilemap consisting of 128 x 64 pixel tiles. Using an ExtendViewport and OrthogonalCamera I am able to render the map. However, it does not scale properly when resizing the window as the aspect ratio of the tiles becomes distorted and occasionally the map will move over to th...
Morten Hauge
1

votes
0

answer
33

Views

How to infinitely scroll a background whilst moving sprites at the same time

I have a scrolling background that i am drawing using a repeating background texture.Now I am trying to place sprites such as stones or holes on top of that background and i want the to move from the top of the screen to the bottom of the screen but insync with the scrolling background. What is the...
tashtoons
1

votes
0

answer
72

Views

My Actor is being drawn right, but its bounds moves wrong

I have an Actor that is a circle drawn by ShapeRenderer, but when I drag it, its bounds moves wrong. before dragging while dragging And the scale of its bounds (green debug line) is also wrong. I think it caused by the incorrect transformation matrices between Batch ad ShapeRenderer but not sure how...
Divelix
1

votes
1

answer
121

Views

Libgdx: library not showing up on autocomplete even after successful build?

I'm using Android studio and I want to add a graph library to my libgdx desktop app. I followed the instructions on the libgdx docs and added the library to my root build.gradle file like so: project(':desktop') { apply plugin: 'java' dependencies { compile project(':core') compile 'com.badlogicgame...
nz_21
1

votes
2

answer
180

Views

libgdx how to detect collisions?

I have a Problem to detect collisions. I'm using TiledMap and created a virtual joystick, so that its possible to move in every direction not just left, right, top, bottom. The Point of View is directly 90 degrees from the top. I don't know if that's the purpose of a TiledMap, but I thought the map...
Domooo93
1

votes
0

answer
43

Views

c# quaternion reference system

I'm working on an Android app which extracts a Quaternion relative to a rotation, then sends its axis/angle representation to C# in order to operate a 3D rotation of a vector. I need this to be done outside Android (in my C# application), but for testing I'm doing it on both Android and C# to be sur...
magicleon94
1

votes
1

answer
97

Views

box2d world step never returns (game freezes)

I'm developing a game with libgdx version 1.9.8 using box2d and Android Studio. https://github.com/agmCorp/GameThree My game is about a character who is moving up on the screen, shooting enemies (typical 'shoot them all' game). The camera is always moving upwards (my game is a Top-Down-View game) an...
Alvaro
1

votes
0

answer
55

Views

LibGdx Power Of Two Texture Size For Texture Atlas Only?

I was reading about POT of textures and their benefits, was curious , let's say I put many non-POT textures into a texture atlas (basically a single texture) whose size is a power of two, do I still get the benefits?
Ersen Osman
1

votes
0

answer
80

Views

retrieving MapObjects from TiledMap map object in libGDX

I'm trying to retrieve an object layer named 'collisions', I'm using this code; MapObjects mapObjects = tiledMap.getLayers().get('collisions').getObjects(); But I get a null exception error. If I try to use .get(index) MapObjects mapObjects = tiledMap.getLayers().get(4).getObjects(); I get an index...
LiveToLearn
1

votes
1

answer
15

Views

Input not processed through InputMultiplexer

I'm attempting to process 2 different inputs - One from an InputProcesser, and another from a Scene2D stage. For some reason it works when I use Gdx.input.setInputProcessor(stage); but not when I use InputMuliplexer multiplexer = new InputMultiplexer(stage); Gdx.input.setInputProcessor(multiplexer);...
Joseph Keane
1

votes
1

answer
99

Views

Android Libgdx - Sigsegv 11 error on real device but no crash on emulator

I am currently trying to make an application with libgdx on android. The application is working fine on emulator of android studio but there is a crash with my real phone when I do a world.destroy(body) with the library box2d. More precisely, during the execution of the game, the application destroy...
Sagawill
1

votes
0

answer
66

Views

Libgdx disable scrollpane animation

I have a scrollpane where I set the Y position and I want to disable the scrolling. This is my code: // create root VerticalGroup root = new VerticalGroup(); root.center(); root.bottom(); root.reverse(); root.pad(getPadding()); root.space(getPadding() * 2.5f); // add some label's and button's to the...
Mewel
1

votes
0

answer
35

Views

Does the sprite in LibGdx change if I change the origin?

If I add a collision to a rotating sprite and I change the origin of the sprite so that it is rotating on a bigger radius does the origin effect the site of the collision? Oh, and is there a way how I can display the collision (as a border or smth)?
jericho
1

votes
0

answer
167

Views

Android “optimizing” my app (libgdx game, actually) on every reboot, still app runs very slow when launched

EDIT: it really was a bug in AS 3.1.1 related to D8 compiler as stated here. It's said to be fixed by now in AS 3.1.3, although I didn't check that myself. I know it means it performing AOT compilation. The thing is that I get a lot of reviews saying 'everything was fine before the latest update, b...
AlexeyGorovoy
1

votes
0

answer
69

Views

BlueJ controlling memory inside of software or method

For my final project I made a game using mostly LibGDX, JavaFX and some networking imports, I dealt with deleting everything once it was used to save as much memory as possible and it runs completely smooth on my home laptop. However the computer in school in which I have to present on crashes at th...
Anonymous
1

votes
0

answer
77

Views

Library project showing wrong modules

I have two projects side by side A library containing two modules - a custom view and a sample application A LibGdx application with several modules, dependent on the library project The problem is, when I open the library project in Android Studio it shows all of the modules from the LibGdx project...
Nick Cardoso
1

votes
1

answer
157

Views

Trouble with libgdx and libgdx-sql lite

everything worked perfectly and when i tried to debug my game i got error: Program type already present: com.badlogic.gdx.sql.Database Message{kind=ERROR, text=Program type already present: com.badlogic.gdx.sql.Database, sources=[Unknown source file], tool name=Optional.of(D8)} I'm using libgdx and...
Dusan Lilic
1

votes
1

answer
38

Views

libgdx: Images don't disappear when I switch screen

At this moment I have 2 screens: MainScreen (it's the main menu of the game) and GameScreen. I have a 'button' (it's an image) that when the user clicks on it, the MainScreen switchs to the GameScreen. The problem is that all the images of the MainScreen don't disappear when the second screen appear...
MarcusF
1

votes
1

answer
350

Views

Creating a TextField in LibGDX

I am working on an Android game using LibGDX and am trying to make a TextField to take in a player's name.This is what I have so far: TextField.TextFieldStyle style = new TextField.TextFieldStyle(); style.font = new BitmapFont(); style.fontColor = Color.CHARTREUSE; TextField field = new TextField(''...
A.J. Kolbasowski

View additional questions