For my application, I need to render sprites (or textures) and PolygonSprites (or Mesh) in the same frame. For the sprites, I render them on a Spritebatch, and for the PolygoneSprites, I should render them on a PolygonSpritebatch. But I really can't do that :
spriteBatch.begin()
spritebatch.draw(sprite)
...
spriteBatch.end()
polygonSpritebatch.begin()
polygonSpritebatch.draw(polygonSprite)
...
polygonSpritebatch.end()
spriteBatch.begin()
spritebatch.draw(sprite)
...
spriteBatch.end()
etc...
So, is there a way ? Image is attached to see what i want.
Thank's a lot !

Short Answer:
You can use a
PolygonSpriteBatchto draw aSpriteas well as aPolygonSpritelike this:Longer Description:
Drawing a
Spriteor aPolygonSpriteis done a bit different from the example code in your question. Since neitherSpriteBatchhas a methoddraw(Sprite)norPolygonSpriteBatchhas a methoddraw(PolygonSprite)you can't dospriteBatch.draw(sprite).The way to do this would be like this:
Now since PolygonSprite.draw takes a
PolygonSpriteBatchas a parameter, you won't be able to pass aSpriteBatchto this method.But since Sprite.draw takes a Batch object as argument, you can pass either a
SpriteBatchor aPolygonSpriteBatchas the parameter (since both of these classes implement theBatchinterface).