[LibGDX] Scene2D Image Skin constructor

I’m working with Scene2D and I’ve noticed that you can create an Image actor using a skin. In the default skin JSON fine, you seem to use the name of an image atlas attribute to define a drawable. For example, the ButtonStyle object:


com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: {
	default: { down: default-round-down, up: default-round }, // uses image atlas attributes to define drawables
	toggle: { down: default-round-down, checked: default-round-down, up: default-round }
},

Image doesn’t have a style yet you can still retrieve a drawable from the skin. Does this mean that to create an image, if I had an attribute named flower in an atlas then I would do the following:


Image image = new Image(skin, "flower");

Or would I somehow have to define the drawable in the skin file?

RTFM :slight_smile:


Some skin resources come from an atlas. This is probably where your “flower” drawable comes from.