L4mbo
L4mbo

Reputation: 43

Is there a way to render a Tiled image layer with slick2d?

map.render(0, 0) 

only renders the tile layers and not the image layers.
And when I print

map.getLayerIndex("[name_of_my_image_layer]")

it returns -1.

Upvotes: 0

Views: 187

Answers (1)

LOLWTFasdasd asdad
LOLWTFasdasd asdad

Reputation: 2903

As far as I know Slick2D does only support tile and object layers from Tiled. See: http://slick.ninjacave.com/javadoc/org/newdawn/slick/tiled/TiledMap.html

You could try: getLayerCount(). Is it returning the right number of layers? I'd assume it would return the right number of layers except for the image layers. Because Slick2D can't detect them. It might be able to detect them, but it can't process them properly.

Depending on what you want to do you might be able to do a work around. You can either use the object layer and attaching an image to an object you created or drawing the image directly via Slick2D. You also could extend Slick2D with the functionality of processing image Layers, since it's pretty straight forward.

Upvotes: 1

Related Questions