New answers tagged

0

The sourceRect is much better for this. Watch this if like a funny video explaining why: https://www.codeandweb.com/what-is-a-sprite-sheet-performance The more technical explanation: I am using pseudo code - the exact number of commands required might vary - but you should see what I am talking about. If you use isolated sprites the game engine has to ...


0

Using the sourcerect is better performance wise. The GPU benefits from as little texture changes as possible. With a textureatlas one texture is sent to the GPU and all sprites can be batched without a texture change. In reality sprites are actually quads with each vertex points to a coordinate in the texture based on the source rectangle. All vertices ...


0

Judging from the documentation on the Animation class in slick, it looks like some of your parameters are incorrect. frames - The sprite sheet containing the frames x1 - The x coordinate of the first sprite from the sheet to appear in the animation y1 - The y coordinate of the first sprite from the sheet to appear in the animation x2 - The x ...



Top 50 recent answers are included