Questions tagged [scene2d]

Scene2D is the scene graph library that comes with LibGDX.

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

I use skin composer, I want to create scene in scene composer, I can't add text buttons even though I created text buttons

I create text buttons, add every image and font, but it's still disabled when I want to add button in scene composer. I'm probably doing something wrong.
p3tition's user avatar
0 votes
1 answer
39 views

Play each scene at godot 3.1

I have created a project. And I have saved 20 scenes for 20 game levels. I have designed each scene but when I hit f5 to play each scene, it shows level1 scene. I don't know what the problem is.
Nina Monti's user avatar
1 vote
0 answers
100 views

Libgdx table contents are expanding beyond widget bounds

I have a libgdx table that initially looks like this... And I'd like the last cell to expand so that the logical bounds fill the widget bounds. As soon as I set the last cell to expandX it looks like ...
The Shoe Shiner's user avatar
0 votes
1 answer
182 views

Libgdx pre-rendering Bitmap font to pixmap texture causes slow in-game rendering

Im using libgdx scene2d to render 2d actors. Some of these actor groups originally included scene2d Label actors for rendering static text. The Labels work fine but drawing ~20 of them on the screen ...
The Shoe Shiner's user avatar
0 votes
1 answer
139 views

How to interact with inventory only and not the game

I have created an inventory in which you can select some objects that you can spawn. This is a button in a table in a inventory class. Spawning is done via left mouse button (just click on some ...
mirzak's user avatar
  • 101
1 vote
1 answer
788 views

Resize and move widgets when screen resized

I want to add buttons to my libgdx based game and have them be independent of the window's size, but when I resize the window, the buttons stretch and deform instead of being resized and/or moved. ...
happun's user avatar
  • 21
0 votes
1 answer
118 views

LibGDX changing actors parents is resulting in unwanted (x,y) translation

I have a Rolodex of task item actors I want to drag to an agenda tablet. My drag and drop functionality is non-native, but came from modifying a book's implementation. The problem seems to be when I ...
RocketScienceGuy's user avatar
1 vote
1 answer
278 views

(LibGDX) Set actor to fixed position on TiledMap

How can I set an actor to an absolute / fixed position on my TiledMap, such that it does not follow the camera when I pan around? Currently my code looks like: ...
Claire's user avatar
  • 11
0 votes
1 answer
615 views

How to keep loading screen for minimum time?

Making my first game and stuck at keeping the loading screen visible for some time. It shows for an instance and disappears. By using loadasync the previous scene runs in the background? Do i have to ...
PhoenixGod's user avatar
0 votes
1 answer
213 views

How do I make an actor move to the foreground temporarily in LibGDX scene2d?

I have an inventory UI which is a table in scene2d. Then the table had a bunch of Containers which are basically inventory slots. They have a transparant grey background color. Then in each container ...
Tipsi's user avatar
  • 131
0 votes
0 answers
39 views

How can I spawn and drag 2d object from a Canvas button?

I want to create and drag an object from canvas button to scene. How can I do this?
next age's user avatar
0 votes
1 answer
340 views

Why is this LIBGDX Action behavior THE EXACT OPPOSITE of what I expect?

Here is a code snippet of the relevant section in my render loop. My intention was to make the actor who was currently focused blinking, to indicate that it was the currently selected UI element. But ...
cafeTechne's user avatar
0 votes
1 answer
91 views

How do I properly link an OrthographicCamera to a OrthogonalTiledMapRenderer

how to properly link an OrthographicCamera to a OrthogonalTiledMapRenderer How do I properly link an OrthographicCamera to a OrthogonalTiledMapRenderer? I have tiled map i'd like render and two ...
Macmanmatty's user avatar
1 vote
1 answer
2k views

Running a scene in the background

I've made 2 scenes where a room is another scene and the other is the outside of it. But whenever I do something in either scenes, and enter the other, it resets everything I did in the first one. I'm ...
Nicole James Cresencio's user avatar
1 vote
2 answers
773 views

Focus scene2d UI actors programmatically in libGDX

I am trying to implement keyboard movement in game main menu which is libGDX Stage with UI-Actors. I'm also trying to code this feature myself since I can't neither ...
barsoosayque's user avatar
1 vote
1 answer
1k views

LibGDX play sound when hovering button

I'm trying to make a button that plays a sound when hovering above it with the cursor So far I created a class which extends the scene2d TextButton and I'm adding a FocusListener. The problem is that ...
BlakkM9's user avatar
  • 148
-1 votes
1 answer
658 views

Can't switch to 3d view in game mode in Unity 3d

When I create a new project in Unity 3d 2017.3, I set the development mode to 3d. Let's take an example now. I create a 3d cube object (everything fine till now) and then click the play button. As ...
Vedansh Agrawal's user avatar
1 vote
1 answer
1k views

LibGDX: How can i remove inner actors?

How can I remove these(on the picture) actors if I only have access to root's Window methods getChildren() and getCells() ? I've ...
Vlad Dogadaev's user avatar
1 vote
1 answer
896 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 ...
Arcxz's user avatar
  • 11
1 vote
0 answers
516 views

Help designing Board game using LibGDX

Hi i'd just like to preface this by saying i'm new to game development and currently learning the ins and outs of libGDX. I want to create the board game scrabble however i'm having trouble figuring ...
sleepingOnion's user avatar
6 votes
1 answer
1k views

What is the difference between a Listener and a CaptureListener in LibGDX Scene2D

According to the documentaton. Adding a listener : Add a listener to receive events that hit this actor. Adding a capture listener : ...
Cedric Martens's user avatar
1 vote
2 answers
260 views

For loop not detecting Actors in draw method. (libGDX)

Question: In my code, I want to draw my actors through a For Loop. However the for loop doesn't seem to detect the addActor() call or even other libGDX calls. Code: ...
Joel Jacob's user avatar
1 vote
0 answers
149 views

LibGDX Scene2D.ui - Resizable composite widget

I have a custom widget, composed by a button and a text field: ...
persson's user avatar
  • 221
2 votes
1 answer
2k views

LibGDX - Wait for action to complete

With Scene2D, in the act() method of a Group, under certain circumstances I add actions to some children (eg a moveTo, or a ...
persson's user avatar
  • 221
0 votes
1 answer
171 views

UI gameover score

I have gameover canvas and i like in gameover canvas to show finaly distance i make with PlayerPrefs but doesnt work because is on same scene what can i do for this problem. ...
Driton's user avatar
  • 15
7 votes
1 answer
4k views

What is the difference between expand(), grow() and fill() in libGDX?

I am currently working with scene2d tables. But I am tired of using hit and trial to make the layout I wanted. Can anyone explain the meanings of expand, fill and grow? I need the behaviour like ...
Nabin Bhandari's user avatar
2 votes
1 answer
2k views

How do I create a ToggleButton via code?

How do I create a ToggleButton via code? I tried using ButtonGroup. Using a CheckBox works, ...
ravend's user avatar
  • 185
0 votes
1 answer
773 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 ...
MukRaker's user avatar
0 votes
1 answer
290 views

LibGDX search for file types in local file system

I'm building a system that allows users to upload files to LibGDX's local directory to play them in the game. How can I search recursively through the local file system for a specific file type and ...
Tessa Painter's user avatar
0 votes
1 answer
462 views

LibGdx table with label children at fixed positions

I'm trying to make a table containing three labels in each row. Something like this: Label1 Label2 Label3 Text1 Text2 LongerText LongTextLoremIpsum LongTextLoremIpsum LongTextLoremIpsum Is there ...
simernes's user avatar
  • 101
0 votes
2 answers
1k views

Resize font when screen resizes desktop Libgdx

I create my font using the following code: ...
Andy's user avatar
  • 45
3 votes
1 answer
1k views

How to create card layout in a trading card game Libgdx

I am trying to create a card layout for my trading card game. Right now I use this code: ...
Andy's user avatar
  • 45
0 votes
2 answers
133 views

Libgdx Scene2D second screen animating and accept input while still loading

I'm currently developing an app Scene2D that involves a small number of screen switches. I am having a problem that after calling set screen there appears to be a pause of a second or two (I think it'...
Moz's user avatar
  • 141
0 votes
0 answers
365 views

LibGDX Scene2D and updating labels inside a table

I have a (Scene2d) Table containing a Label, both added to a Stage, and I'm properly calling stage.act(float) and stage.draw(). ...
Max's user avatar
  • 306
1 vote
2 answers
972 views

How to make members of an Array into an actor and add them to stage?

I have an animation (enemies) that I would like to add multiple times on the screen. From what I know, I can save memory and framerate-per-second by using one animating image and make an arraylist of ...
JAlmazan's user avatar
1 vote
1 answer
641 views

LibGDX How to set spacing between list items in a Scene 2D Select Box Widget?

I have created a Select Box (Scene2D widget) which holds a list of items, to be selected. My code works fine, but I would like to make a little more spacing between each list item in the dropdown list ...
Martin Rohwedder's user avatar
0 votes
1 answer
872 views

Libgdx: api fadein() and fadeout() methods are switched?

I've been trying to create a white-screen fade effect for my libgdx game. When I run the following code with fadeOut = false, nothing happens (white-screen does ...
Eric's user avatar
  • 783
0 votes
1 answer
999 views

Use Ashley with Scene2d in libGDX?

I want to use Ashley but I also want to use actions and listeners with Scene2d. I read that it is not a good idea, but why? Ican create a system with stage.act(); and stage.draw(); in the update ...
Lordeblader's user avatar
0 votes
3 answers
691 views

Actor in Stage Does Not Update the MoveTo XY Location

I am creating a game wherein an apple is being shot with an arrow. The apple's location is the XY location of the user input and the arrow actor has to move to that location using the code actor....
JAlmazan's user avatar
1 vote
2 answers
132 views

Image Does Not Animate and is Stuck in one Frame

I'm having a problem in my code where the animation from another class does not animate and is stuck in one frame. The image moves across the screen in the right manner though. I know that the problem ...
JAlmazan's user avatar
1 vote
1 answer
556 views

Undetected Null Pointer Exception in TextureRegions

I have an error regarding Null Pointer Exception and I can't find the exact location of the error in my program. I have searched for probable solutions online but I find none of them helpful. I know ...
JAlmazan's user avatar
0 votes
1 answer
247 views

libgdx scene2d DelayAction and SequenceAction

I'm trying to get the delay action in scene2d working correctly. I have multiple image objects which I store in an array and I have managed to get them all displaying, scaling and moving correctly. I ...
Amar_H's user avatar
  • 3
2 votes
1 answer
246 views

Libgdx scene2d not erasing old texture

I've been having trouble with getting scene2d to erase my old texture when I switch screens, and also when I change my label the old label string is still drawn underneath. ...
joey babaganoosh's user avatar
0 votes
1 answer
443 views

How to smooth scene2d ui default skin?

I am usng uiskin.png, default.fnt, uiskin.atlas to create my game UI, but the images is blurred, How do I make it smooth?
ronscript's user avatar
  • 501
1 vote
2 answers
159 views

LibGDX - question about game UI

I have question about game UI. Im using only one Screen class in my game and for different "screens" Im using gamestates. My question is how to set stage with buttons (play button, pause button, ...
Land93's user avatar
  • 181
0 votes
1 answer
406 views

libGDX - Scene2d Actions or Frame Animation, which is better for performance?

I only use Scene2d for the UI layer of my libGDX game. But I need some animations like fading or rotating on my players. Which is better for performance: Scene2d fade action or having multiple ...
Sharpirate's user avatar
1 vote
2 answers
1k views

GUI scaling: Viewport-based scaling or individual logic

I want to use scene2d for creating a GUI for a libGDX game. In scene2d all sizes are provided in pixel units (instead of percentages). So I wonder what is the best approach to deal with different ...
Sebastian's user avatar
  • 197
0 votes
1 answer
567 views

Animations not working using scene2d and actor class in LibGDX

I have a problem making a simple animation using the Actor class. ...
Txoloentertainment's user avatar
2 votes
2 answers
3k views

LibGDX: How to handle Touchpad input?

I know that you can just write a code like this in the render method: ...
Alex Pi's user avatar
  • 93
1 vote
1 answer
1k views

Scene2d scrollbar not showing even though it exists in uiskin.json/atlas

Using uiskin.json, uiskin.png, uiskin.atlas, default.fnt from libgdx tests I'm trying to make a console window, however the scroll bar is not shown. uiskin atlas ...
MrPlow's user avatar
  • 337