The tag has no wiki summary.

learn more… | top users | synonyms

27
votes
2answers
8k views

How exactly does XNA's SpriteBatch work?

To be more precise, if I needed to recreate this functionality from scratch in another API (e.g. in OpenGL) what would it need to be capable of doing? I do have a general idea of some of the steps, ...
5
votes
5answers
5k views

Why do I get this file loading exception when trying to draw sprites with libgdx?

I'm having trouble with the "Drawing Images" section on the libgdx tutorial. I set up the documents completely and I typed the code as follows: public class Game implements ApplicationListener { ...
6
votes
1answer
4k views

Repeat texture in libgdx

How to fill region with repeated texture? Now I'm using next method: spriteBatch.begin(); final int tWidth = texture.getWidth(); final int tHeight = texture.getHeight(); for (int i = 0; i < ...
3
votes
2answers
626 views

XNA: Regarding SpriteBatch.Draw()

I was trying to develop a very simple ping pong game using XNA. In my Draw() I am drawing the player paddles first then the ball as follows: spriteBatch.Draw(myPlayer, myPlayer1Pos, null, ...
2
votes
2answers
993 views

How to use batch rendering with an entity component system?

I have an entity component system and a 2D rendering engine. Because I have a lot of repeating sprites (the entities are non-animated, the background is tile based) I would really like to use batch ...
2
votes
3answers
2k views

Can I use SpriteBatch when drawing sprites on a rotating 3D plane

I'd like to have my plane of sprites rotate similarly as in this game (YouTube Video). So basically, everything is drawn in 2D, but the 2D plane is then "rotated in 3D" (or camera is rotated). When ...
1
vote
1answer
144 views

Spritebatch not working in winforms

I'm using the Winforms sample on the app hub and everything is working fine except my spritebatch won't draw anything unless I call Invalidate in the Draw method. I have this in my initialize method: ...
1
vote
3answers
2k views

XNA SpriteBatch.Draw with rotation, scaling and origin?

I use a 1x1 pixel 2d texture as source for SpriteBatch.Draw. The texture is scaled and rotated around an origin. The left image is only scaling. The right one scaling + rotation around the origin at ...
1
vote
1answer
2k views

XNA 4.0 - Mixing 3D and 2D - SpriteBatch putting weird alpha texture over whole scene

I am working on a game in XNA 4.0 that has been entirely in 3D so far but now I want to incorporate a HUD. I have tried doing a simple test using spriteBatch as such: spriteBatch.Begin(); ...