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
2 answers

libGDX MoveToAction nullPointerException

I have started a small project to help me learn scene2D in libGDX and keep running into a nullPointerException. My goal is to get the player to jump by using and actions sequence. My issue is that the player does jump up, but once it falls back down…
Chief Peanut
  • 59
  • 2
  • 8
0
votes
1 answer

Libgdx UI using Scene2d.ui -does it work on iOS?

I want to create a simple game for Android and iOS primarily using libgdx. The game is going to need UI in the form of text input fields and buttons. Now, there is a package called Scene2d.ui which has for instance the class TextField. However, it…
JohnyTex
  • 3,323
  • 5
  • 29
  • 52
0
votes
2 answers

scene2d: how to fire(event) and handle at scene/root?

i am trying to escalate touchDown and touchUp events from an actor Object to my applicationListener class. To do so, i called fire(event); in the InputListener of my Actor this.addListener(new InputListener(){ public boolean…
0
votes
1 answer

Touchevents using libgdx and scene2d

i am currently going through some tutorials on android development and libgdx/scene2d atm but got stuck on the touchevents: For starters i am implementing a board game. By now i managed to draw the board and some meeples (player tokens) as well as…
0
votes
1 answer

Using a joystick or gamepad to traverse through scene2d menu

I'm wondering how I can add support easily to traverse my scene2d menus (tables) with LibGDX using a joystick, gamepad or keyboard keys. Does anyone know how it should be done?
RobotRock
  • 4,211
  • 6
  • 46
  • 86
0
votes
1 answer

Libgdx scene2d Touchpad gets 'inverted' when setting bounds too small

I'm making a game with Java and Libgdx scene2d. This is my code in the constructor: atlas = new TextureAtlas("gfx/button.pack"); skin = new Skin(atlas); TouchpadStyle touchpadStyle = new TouchpadStyle(); touchpadStyle.background =…
ploosu2
  • 413
  • 6
  • 15
0
votes
1 answer

LibGDX - Scene2d cannot click on widgets

I have created a screen in my application that shows a text field and a button but for some reason I cannot click on them. Do you have any idea what might be the reason. That's my code (I skipped the variable declarations): public class…
user43051
  • 345
  • 2
  • 5
  • 17
0
votes
1 answer

Rendering a scene2d ui on top of box2d

Im currently having issues with rendering a UI on top of a box2d playarea. As of currently the button is rendered in the corner of the screen but does not react on clicks as it seems the screen believes it isnt there. Only the picture of it. Below…
Lucas
  • 129
  • 1
  • 12
0
votes
1 answer

Libgdx view frustum culling inside actor.draw()

I am developing a little game using libgdx. It is a 2d top down game with some big maps and many objects on them. So i just want to render things in my view frustum. I have seen the camera.frustum.***inFrustum(Paramter... p). But i am using scene2d…
Robert P
  • 9,398
  • 10
  • 58
  • 100
0
votes
0 answers

Convert a LibGdx image into an acceptable Android Image format

I need to convert a java LibGdx image of type com.badlogic.gdx.scenes.scene2d.ui.Image into an image of type "android.graphics.Bitmap". I need this because I want to share this image using the Android ACTION_SEND Intent. Is there any way to convert…
Wazani
  • 911
  • 1
  • 13
  • 28
0
votes
1 answer

Libgdx scene2d.ui InputListener for custom Actor not working

I am trying to use the Libgdx Scene2dui library and want to catch the mouse touchdown event. I have a custom Actor and a dialog that instantiates an instance of the Actor and tries to listen for touch events. For some reason the touch events are…
0
votes
1 answer

stage still receives event when visible=false?

In document ( https://code.google.com/p/libgdx/wiki/scene2d ) it states that: If setVisible(false) is called on an actor, its draw method will not be called. It will also not receive input events. And my code is:…
mmdc
  • 1,677
  • 3
  • 20
  • 32
0
votes
1 answer

Calculate a fitting text size

I want to calculate the size my Font needs, so my text will be displayed fully in one line without clipping. Example |-100px---HERE'S MY TEXT---100px-| I have the DPI and all there stuff. Testing isn't a way, I am using Libgdx and the text ist…
Xyz3R
  • 1,075
  • 1
  • 9
  • 12
0
votes
1 answer

How to implement box2d light when using scene2d in libgdx

We are making a game using libgdx and we want to know the way to use the light and physics from box2D with the scene2d, It seems that to get light you need be into a World class which contains the required stuff, but I don't know how to get both…
0
votes
3 answers

Scene2d touchDown isn't fired on Actor

I've created a simple test with a touchDown() event on an image actor. The event works on the stage but not on the actor. Here is the code: I set the InputProcessor in the constructor of the parent class…
Drorasta
  • 141
  • 2
  • 5
1 2 3
34
35