Questions tagged [scene2d]

Scene2d is a 2D scene graph for building applications and UIs using a hierarchy of "actors". Integrated in libGDX.

Scene2d is a 2D scene graph for building applications and UIs using a hierarchy of actors. Integrated in . It provides the following features:

  • Rotation and scale of a group is applied to all child actors. Child actors always work in their own coordinate system, parent transformations are applied transparently.

  • Simplified 2D drawing via SpriteBatch. Each actor draws in its own un-rotated and unscaled coordinate system where 0,0 is the bottom left corner of the actor.

  • Hit detection of rotated and scaled actors. Each actor determines if it is hit using its own un-rotated and unscaled coordinate system.

  • Routing of input and other events to the appropriate actor. The event system is flexible, enabling parent actors to handle events before or after children.

  • Action system for easy manipulation of actors over time. Actions can be chained and combined for complex effects.

519 questions
8
votes
2 answers

LibGDX initialize Drawable

This is a Question for those who are familiar with the new LibGDX 0.98. I'm not quite sure, how to use a Drawable in the Scene2d package. My current code for using a ".png" as a Background for various classes looks like this: new…
Xerusial
  • 525
  • 1
  • 5
  • 17
7
votes
1 answer

Table.getHeight() always returns 0 though it shouldn't

I'm trying to arrange and scale some elements inside a table and I need to know the Table's height in order to achieve all that. The problem is that whenever I try to get its height it always returns 0 even though the table is obviously on the…
gogonapel
  • 788
  • 6
  • 17
7
votes
2 answers

Libgdx How to implement list of checked buttons?

How can I implement a list of horizontally aligned buttons in which only one button can be checked at a moment? I wanted to implement this for a game in which you have to select the tool from a list and click on an object to perform an action. I…
Andrew
  • 1,109
  • 1
  • 15
  • 27
7
votes
3 answers

Get an actor by name in libgdx

How do I get an actor by name in libgdx? I currently have the following ChangeListener: ChangeListener colorPickerListener = new ChangeListener() { public void changed(ChangeEvent event, Actor actor) { //Popup…
joshmmo
  • 1,062
  • 2
  • 13
  • 28
7
votes
1 answer

LinearLayout analog inside Table in LibGDX

I want to create a game menu screen in LibGDX using scene2d package with following layout | label | | btn btn btn | | label | My code looks as follows: Table table =…
Dmitriy Tarasov
  • 1,949
  • 20
  • 37
6
votes
1 answer

Center SelectBox text in libgdx using scene2d

I have the following SelectBox: //Select Box Style SelectBox.SelectBoxStyle boxStyle = new SelectBox.SelectBoxStyle(); boxStyle.fontColor = settingsFontColor; boxStyle.background = new SpriteDrawable(rectangle); boxStyle.font =…
joshmmo
  • 1,062
  • 2
  • 13
  • 28
6
votes
2 answers

LibGDX How to implement scene 2D menu tabs?

I have made an alpha version of my rpg and now I want to implement a menu with multiple tabs. When you are in game and press tab or escape I want to show a user interface that will have a bar top with 3 buttons like main menu, skill tree and…
Andrew
  • 1,109
  • 1
  • 15
  • 27
6
votes
4 answers

scene2d button scaling with libgdx

I don't know if it is just me, but drawables confuse me. Are they intended to keep the size they are given, or is there a way to scale the image within them? I understand they can use ninepatch to fill certain areas by stretching an image, but I…
Austin Gibb
  • 303
  • 1
  • 4
  • 12
6
votes
2 answers

Unbound classpath variable junit and log4j when importing a libgdx project in to eclipse

I'm trying to import and run the project listed here: Scene2d Actions and Event Handling I start by downloading the zip file and then importing it in to eclipse. From here I get the following three errors (after resolving others pertaining to…
user1170304
  • 315
  • 1
  • 3
  • 12
5
votes
1 answer

Libgdx UI that show information or text when hovered

I'm making a game using libgdx which has a lot of buttons and text fields, I was wondering if there was a Scene2d widget which the user can hover and then a message shows up, something like this.
Kevin Bryan
  • 1,846
  • 2
  • 22
  • 45
5
votes
3 answers

Cannot loop an action. libGDX

I've asked a question like 4 days ago. Got some help and now my code looks like ColorAction actionBtG = new ColorAction(); ColorAction actionGtB = new ColorAction(); SequenceAction sequenceAction; RepeatAction repeatAction = new…
Gtzzy
  • 519
  • 4
  • 18
5
votes
1 answer

How to center actors in a group with Scene2d and LibGDX?

I'm using LibGDX and Scene2d and I want to create a pop-up that looks like the one shown in the image below. So far, I created a table and set the background to a semitransparent color. Then I created an image with a white background. This image…
Antict
  • 597
  • 5
  • 22
5
votes
1 answer

libGDX Stage input handling

I have an Stage class that handles touch input. In the Screen class I set the stage as InputProcessor: stageTest = new StageTest(new ScreenViewport()); Gdx.input.setInputProcessor(stageHUD); But now I want to add a force to an Box2d object always a…
user4959397
5
votes
1 answer

Game crash if interrupted while Splash Screen is on - LIBGDX

I have a splash screen and a menu screen class that loads all my texture atlases and skins for the menu and processes lots of stuff. If I put the constructor for the menu screen in the SplashScreen constructor or in the create() method of my main…
gogonapel
  • 788
  • 6
  • 17
5
votes
1 answer

Libgdx ScrollPane adding space at the top

I'm creating a store for my game and I'm having issues with the libgdx ScrollPane. It seems to be moving the table within it down by 155px. The effect it's having is that the table appears roughly 155px down from the top, and the last button is off…
Townsfolk
  • 1,282
  • 1
  • 9
  • 21
1
2
3
34 35