8
votes
Accepted
What is the difference between expand(), grow() and fill() in libGDX?
Expand: expands the cell that the actor is currently placed in to occupy the largest possible area without changing other cells size. For example if the cell is <...
7
votes
LibGDX : Textfield input type
I found out a solution to your other problem. To allow the typing of a dot you should create your own implementation of TextFieldFilter like this.
...
6
votes
Accepted
What is the difference between a Listener and a CaptureListener in LibGDX Scene2D
According to the official LibGDX wiki, capture listeners are called before "normal" listeners to give you a chance to intercept the events. (i.e. Active window cancels click on button under ...
4
votes
Scene2D set table cell size in percentage of tables ´s size
You can change the Actor that the Value acts on by supplying the actor (in your case your ...
4
votes
Independent Column sizes in Scene2D Table in LibGDX
There is an option to do this:
First of all you need to find out what your smallest size of a column is, therefore you have to merge all rows into one and pick the smallest width of all columns.
the ...
3
votes
Accepted
Undetected Null Pointer Exception in TextureRegions
You don't initialize your currentframeRight and currentFrameLeft in the constructor.
Put this in the constructor of ...
3
votes
Accepted
Scene2d scrollbar not showing even though it exists in uiskin.json/atlas
The cause of this problem is actually the way I constructed the ScrollPane object. I called the ScrollPane(widget) constructor ...
3
votes
Accepted
How to create card layout in a trading card game Libgdx
How does this look? (Green and red lines are only there for debugging)
What I did to achieve this was to first separate the card into three columns and five rows; then I had the Cost, Life, Attack, ...
3
votes
Accepted
How do I create a ToggleButton via code?
Quoting the javadocs of the Button class:
Each time a button is clicked, the checked state is toggled.
So the buttons are probably checked, you just can't see ...
2
votes
LibGDX: Do I have to dispose a texture if I load it from AssetManager?
You shouldn't call dispose directly on a Texture loaded by an AssetManager, they are ...
2
votes
Accepted
LibGDX: Problems with Button Listener in a Dialog
The problem is, that I should not add a listener when I'm using the "button()" method, the correct way to use this method is, simply add the button, and as a second argument, you pass an object to ...
2
votes
LibGDX: How to handle Touchpad input?
Why not just use it with a Stage and Table as intended?
...
2
votes
Accepted
How to smooth scene2d ui default skin?
Open ui_skin.atlas in your GDX project and change the 3rd line to:
filter: Linear,Linear
It will apply linear min/mag filters to textures and they should look a ...
2
votes
Stopping Actor tap/click event from propagating
I had the same problem with a window (scene2d.ui.Window). It would propagate click and other events though it shouldn't. I solved it by doing this:
...
2
votes
Accepted
LibGDX How to set spacing between list items in a Scene 2D Select Box Widget?
You can do this using:
selectBoxStyle.listStyle.selection.setTopHeight(10);
2
votes
Accepted
LibGDX - Wait for action to complete
You can create an Action that is shared across Actors and that counts down a value to zero, then use this state in conjuction ...
2
votes
Accepted
LibGDX play sound when hovering button
I'm assuming you want to play the sound only once during the whole time of the hover.
Since SoundManager does not track sounds it plays, you want to set a flag preventing from playing the sound twice....
2
votes
Accepted
Libgdx pre-rendering Bitmap font to pixmap texture causes slow in-game rendering
The cause of this slowness was my misunderstanding about Libgdx culling. Scene2d does not automatically cull objects outside of the view frustum. Therefore my hundreds of shapes and labels were having ...
1
vote
Accepted
Libgdx scene2d not erasing old texture
Try changing your render methods to this;
For StartScreen:
...
1
vote
Accepted
LibGDX - question about game UI
Create two separate listeners and plug them when you switch your stage/gamemode. Like this:
...
1
vote
LibGDX - question about game UI
If you don't have too many buttons/tables and the project is relatively small then using different "if"s is perfectly fine.
If you have several of them then it would be better to have a function that ...
1
vote
libGDX - Scene2d Actions or Frame Animation, which is better for performance?
I write in LibGDX for a while and in my opinion it's better to write players movement/rotation/jumping in the code directly and leave Actions for the UI.
It depends ...
1
vote
Accepted
GUI scaling: Viewport-based scaling or individual logic
The Android-style would be to create custom layouts for each viewport size. This limits you, of course, to only handling a fixed set of viewport sizes but there are only a limited number of monitor ...
1
vote
GUI scaling: Viewport-based scaling or individual logic
libgdx provide a utility class called viewport to deal with different screen resolutions problem , each time the screen resolution changes you have to update the viewport:
...
1
vote
Accepted
Scene Transition in libgdx
There are a lot of different kinds of transition. To concretely answer this question clarify which kind of transition you are looking for.
If you want to do a blended transition, you'll need to ...
1
vote
Table background not showing up
I've had this exact problem before, so I'll try to remember how I solved it.
I recommend turning on the stage.debugAll() while you develop: It is a god send at ...
1
vote
LibGDX, vertical group not displaying
It seems that if the VerticalGroup is added to another layout, then it works. Looking at the code, this is due to VerticalGroup ...
1
vote
Hand cards auto arrangement
I would comment on Daedrics answer but I don't have enough rep. His detailed explanation is great and is pretty much already handled by LibGdx's HorizontalGroup() ...
1
vote
Creating actor comprising multiple other actors - controlling where pieces are drawn
From the comments: the solution seems to be to make MyActor extend Group, then add the constituent actors to that group.
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
scene2d × 88libgdx × 81
java × 29
android × 12
animation × 5
gui × 5
unity × 4
c# × 3
fonts × 3
android-studio × 3
inventory × 3
textures × 2
box2d × 2
performance × 2
scale × 2
card-game × 2
2d × 1
rendering × 1
sprites × 1
input × 1
transformation × 1
game-loop × 1
entity-system × 1
coordinates × 1
godot × 1