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 scene2d multiple rotations around different origins

I have an actor that i need to rotate 2 times. Each time around a different origin. But it seems the actor just saves the origin set with setOrigin() and and the rotation set with setRotation() and calculates it when drawing. So if i simply set…
Kedu
  • 1,350
  • 14
  • 26
0
votes
1 answer

render method warping sound; updated too frequently?

I am using libGDX and aspects of scene2D. I have a main Game class (code below). This main game class implements Screen and has a stage. I have two other classes (Dino and SpaceMonster), which extend Actor. I want to be able to play a Sound once…
jdubbing
  • 99
  • 7
0
votes
1 answer

How can I change font color after its has created

I am using java, libgdx, scence2d. I have set bitMapFont in constructor. Now How can I change font color after its has created? I want to change in render method. This my constructor where I am creating BitmapFont for title and menuItems(3…
user1924249
  • 540
  • 3
  • 13
  • 38
0
votes
0 answers

LibGDX-How to access child actor's attributes through group

I have a Group and some Actors in it. In the actor, i have an attribute called colorCode. Now when I use myGroup.getChildren().get(index) I get a list of methods from Actor class which does not include my getters/setters. Any idea how to access…
Prashant Onkar
  • 414
  • 3
  • 15
0
votes
1 answer

TextButton addLIstener is not responding in LibGdx game?

I have Implemented my MenuScreen as bellow:- private static final String TAG = MenuScreen.class.getName(); private Stage stage; private Skin skinMenuScreen; //private Skin skinLibgdx; // menu private Image…
Sandeep Tiwari
  • 2,042
  • 3
  • 24
  • 47
0
votes
1 answer

LibGDX: setPosition() not working in Android

I'm trying to position a group of actors using the setPosition() method. I want to center the group in the screen continuosly while I'm adding actors, that is to say, I add one actor, the group is centered with one actor; I add a second actor, the…
adrianoubk
  • 225
  • 1
  • 4
  • 12
0
votes
1 answer

Positioning a WidgetGroup in LibGDX

I'm using a HorizontalGroup in LibGDX which works fine. I want to create a row of tiles. But when I try to position the group using setPosition() method, it doesn't position as I hope, that is to say, it doesn't render using my "y" value. Here is…
adrianoubk
  • 225
  • 1
  • 4
  • 12
0
votes
0 answers

Why does my TextButton that switches screens cause my application to crash?

I'm currently trying my hand at LibGDX to create a simple game. Currently I have finished working on the main menu and have tried to program the Level Selection menu. I have the following code in my LevelSelection class but my application crashes…
Rycerub
  • 13
  • 2
0
votes
1 answer

Libgdx: how to draw rectangle around group elements of Scene2D

I want to know how to check collision between elements inside a group and other element of the games, in other word, I want to know how to draw a rectangle around elements of the group, cause so far every time I try, the rectangle is always in the…
alaslipknot
  • 551
  • 4
  • 8
  • 24
0
votes
2 answers

Label not increasing in size

I want make my label of Scene2D larger. I have scaled and set width and height to 200 and higher and it stays the same size. Help? thanks.
Costular
  • 51
  • 2
  • 8
0
votes
1 answer

libgdx Group is not affected by parent Table.row()

I'm trying to create in-game window, using Table class. But when i added groups of images to that table, seems row() method has no influence to groups, they all are in the same place. Using Images instead of Groups works. PS. I used Group to…
0
votes
1 answer

libgdx - adding multiple actors in one table cell with scene2d

I would like to add multiple actors to one table cell with scene2d. My table has 3 cells on each row while I would like to add 10 images to one row. Table tmpTable = new…
user45064
  • 1
  • 1
0
votes
1 answer

LibGDX persist actors while switching screens?

I'm making a game in LibGDX and I have a couple of menu screens using the scene2d ui. I have one MenuBaseScreen super class that sets up the default actors required for each screen. Then i have a MainMenu, Options etc screens that each inherit from…
Johan
  • 231
  • 4
  • 14
0
votes
2 answers

Cannot draw TextButton or Button in LibGDX for desktop

I am trying to make a menu in LibGDX. But I cannot get a Button or a textButton to get drawn in the screen. I tried using the test skin. I tried to use a table. I tried to use a button and a textbutton. The image is fine because it can appears…
perseus
  • 1,322
  • 1
  • 16
  • 22
0
votes
1 answer

How can I add animation (via getKeyFrame) to scene2d actor

I'm using libgdx and scene2d for an android game. I have a stage with actors that can be clicked on to perform various tasks. The actors are currently static images. I have other code that does targeting overlays with targetRingSmall = new…
Sym
  • 187
  • 2
  • 9