6 votes
Accepted

Understanding SpriteBatch.Draw overload XNA

Basic explaination about the method with regards to positioning, scaling and rotating: This draws a sprite with myTexture with the topleft corner on 100,200: <...
Felsir's user avatar
  • 4,067
5 votes

Spritebatch and Shaperenderer

From this topic: http://badlogicgames.com/forum/viewtopic.php?t=8573&p=38930 You should try not to do the following: (Quote from one of the GDX creators) ...
Jacob's user avatar
  • 2,522
4 votes

How to use multiple shaders with LibGdx + SpriteBatch

You can first render your scene to a texture with the first shader, then render the texture with the second shader. This will apply both shaders to your scene. You render to texture using a ...
Charanor's user avatar
  • 7,840
3 votes

Using 60 frames per second causes the screen to leave a drawn trail of textures, when there is movement

You don't need to limit the framerate yourself within LibGDX. The framework handles that for you. You can enable vsync in your game by adding this line to your desktop configuration: ...
Charanor's user avatar
  • 7,840
2 votes

Does scene2d(libGDX) know when an image is drawn out of the screen?

Scene2D already checks if an Actor is on your viewport or not. You don´t need to code that. Edit: I´m searching on the Scene2D documentation about this, I can´t find it, but I know it is true, if ...
Mayuso's user avatar
  • 927
2 votes
Accepted

How to render a trimmed sprite?

What you have to do is roughly the following: Pretend that your sprite has the original size in your game. This is important to keep animations aligned. Instead of rendering the original sprites' ...
Andreas Löw's user avatar
1 vote
Accepted

XNA's SpriteBatch resizing is not sharp as i use it

Thanks to @DMGregory, i've Added the parametter samplerState on SpriteBatch.Begin that fixed everything ...
Louis BERTRAND's user avatar
1 vote
Accepted

Overlaying Menus with a State Machine

One solution to this problem is by executing EACH state on the state machine, or having speicfic states (or transition states) that are defined to execute one before another. A typical implementation ...
Joshua Hedges's user avatar
1 vote
Accepted

Removing/Updating Spritebatch

For updating sprites: You can use bufferSubData to overwrite a section of the buffer with new data. As far as knowing how to index that sprite, they should all be the same size and don't share any ...
Jimmy's user avatar
  • 9,029
1 vote

Rendering sprites on a Mali-400 MP device

Since the rendering glitch shows tiles and half-tiles that might hint at a texture format or encoding/decoding issue (lack of ETC2 support?). Make sure the textures are square, power-of-twos and try ...
Stephane Hockenhull's user avatar
1 vote

SDL2 sprite batching and texture atlases

SDL2 can handle these things. As previously stated you need to make a engine to load the image, the sprite rect or poly, and you could even tie into this a animation frame que to this. I pushed well ...
Matthew Jordan's user avatar
1 vote

LibGDX: I need to get from SpriteBatch to Batch in order to draw a Touchpad

Because SpriteBatch implements Batch this means it can be used wherever a function requires a ...
Charanor's user avatar
  • 7,840
1 vote
Accepted

Are there spritebatch drawing limitations on monogame?

Use an override of the SpriteBatch.Draw() function in order to specify what layer you want to draw your sprites on. You are already specifying "FrontToBack" sort mode in your initialization so that ...
jgallant's user avatar
  • 8,394
1 vote

libgdx: SpriteBatch and ShapeRenderer projection wrong

It looks like you want to draw the circle with half the c.size () as the circle method's third parameter is radius, not diameter....
bornander's user avatar
  • 4,461
1 vote

Does scene2d(libGDX) know when an image is drawn out of the screen?

Yes, it does. But in case you want to be sure, you can check it yourself using Frustrum to compare performances. (If using Frustrum increases performance, then it Scene2D does not check if an ...
Sup's user avatar
  • 11

Only top scored, non community-wiki answers of a minimum length are eligible