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
0
votes
1 answer

LibGDX loading scene2D widgets very slow for first time, need suggestions

I started using scene2D in my LibGDX game to make a more professional looking login/register menu. The only problem is that switching to those menus is very long for menu navigation (3-5 sec). I want to know if there is a better way to load them…
vedi0boy
  • 1,030
  • 4
  • 11
  • 32
0
votes
0 answers

Actor position is incorrect - Libgdx

Please help me, I'm pulling my hair out. I have a class called "HudBarView" which extends the Group class(scene2d). It takes care of the drawing of the HUD Bar at the top of the screen(Pause button, score, etc). Another class I have is "HUDManager"…
David Lasry
  • 1,407
  • 4
  • 26
  • 43
0
votes
0 answers

Using SpriteBatch alongside Scene2D to make a nice chatbox (LibGDX)

I am currently working on a Java 2D MMORPG using LibGDX. I made a chat box completely from scratch using SpriteBatch drawing,it includes a text field to enter a new message to chat and a scroll to scroll through the chat. The only problem is that it…
vedi0boy
  • 1,030
  • 4
  • 11
  • 32
0
votes
0 answers

ImageButton is visible only after resize - Libgdx

I have a class called "HudBarView" which takes care of the drawing of the HUD Bar at the top of the screen(Pause button, score, etc). This class extends the Group class(scene2d). Another class I have is "HUDManager" which takes care of all the HUD…
David Lasry
  • 1,407
  • 4
  • 26
  • 43
0
votes
1 answer

Libgdx MoveToAction - Can't get it to work

I'm trying to use MoveToAction to update an onscreen actor. However, it doesn't seem to be doing anything and I can't find many online examples to help (those that I have found suggest I'm setting it up correctly, though obviously I'm not). I…
wyfyte
  • 31
  • 3
0
votes
2 answers

libgdx - scene2d.ui label position

How can I dock a multiline Label to the bottom of the screen? There's the Label.setY() method but it works in some arcane way that makes no sense to me. I can get the approximate height of the label with getWrappedBounds() but I can't figure out how…
PFort
  • 485
  • 2
  • 6
  • 15
0
votes
0 answers

libgdx: Adding Table to Stage causes Actors that aren't children of the Table to not render, despite not having overlapping coordinates

So, I have a Game Screen that I have set to 800x480, and at the top of that screen I'm trying to create a Table that contains some information. I've set the table bounds to x = 0, y = 380, width = 800, height = 100, and when the screen renders, the…
wyfyte
  • 31
  • 3
0
votes
1 answer

libgdx crashes when i add dialogs

well i am having a problem i've started coding my first game with libgdx and i created the menu i am trying to give the about button a function to open a text dialog box but when i add the code, the game crashes when i run it can anyone link me to a…
0
votes
0 answers

libGDX - How do I add a (mouse)joint to an Actor in scene2d

If I have a GameStage with the following: ... public GameStage() { world = WorldUtils.createWorld(); setUpWorld(); setupCamera(); debugRenderer = new Box2DDebugRenderer(); } private void setUpWorld() { world =…
Charles Bunn
  • 70
  • 1
  • 1
  • 9
0
votes
1 answer

(libgdx/scene2d) Creating different stages with actors etc

I'm fairly new to game programming and just started looking into building my first 2d game with libgdx. I've already build a stage with actors that are drawn to the screen with movement, pathfinding and so on. But I'm a bit confused when it comes to…
stonecompass
  • 547
  • 9
  • 27
0
votes
7 answers

Java: Optimizing algorithm in game

I'm creating a game (Java) with scene2d. I wrote function for collision detection but I think it's bad function. It looks bad. How can I optimize it? Make faster and more beautiful. private void deleteEnemies() { for(int i = 0; i <…
QueMonster
  • 39
  • 3
0
votes
1 answer

My dialog is not showing

Using the UITest on git I'm building a UI. However the popup dialog is not showing, at least I think it is a popup dialog window. Here i setup the button that should open it: ImageButtonStyle style = new…
Madmenyo
  • 8,389
  • 7
  • 52
  • 99
0
votes
1 answer

clickListener not initializing correctly

Sorry I am very new to Java and LibGDX however I'm having a problem. I have two buttons in my Pong game. If score1 or score2 equals 5, the game ends. This is done by making the ball and paddles move off screen then a method called drawButtonRematch…
Ash
  • 47
  • 3
0
votes
1 answer

How is it possible to pause an action of an actor in LibGDX?

I added the following action to my actor: this.addAction(sequence(delay(0.5f), alpha(1, 2), delay(2), alpha(0, 2))); Is there an easy way to pause this animation and then continue it when a button is clicked?
user3740097
0
votes
1 answer

LibGDX Scene2D: Applying Actions to Actors in separate class

I'm having trouble getting a MoveToAction to work on an Actor (menuBackground), when the Actor is in a separate class. I have attached relevant code below- which doesn't make the Actor move at all. I have had success in apply other actions to the…
jdubbing
  • 99
  • 7