The spritebatch tag has no wiki summary.
2
votes
2answers
70 views
XNA Sprite Clipping Incorrectly During Rotation
I'm having a bit of trouble getting my sprites in XNA to draw when near the edge of the screen.
Seemingly if you use SpriteBatch to draw then XNA will not draw it if for example (mPosition.X + ...
2
votes
0answers
57 views
Why is Spritebatch drawing my Textures out of order?
I just started working with XNA Studio after programming 2D games in java. Because of this, I have absolutely no experience with Spritebatch and sprite sorting. In java, I could just layer the images ...
0
votes
2answers
126 views
How can I draw a simple 2D line in XNA without using 3D primitives and shders
I would like to be able to draw arbitary lines in my sprite based 2D XNA game. How can I draw a simple line on screen in XNA without dealing with vertex arrays or shaders.
4
votes
2answers
182 views
Sprite batching in OpenGL
I've got a JAVA based game with an OpenGL rendering front that is drawing a large amount of sprites every frame (during testing it peaked at 700). Now this game is completely unoptimized. There is no ...
6
votes
1answer
193 views
How can I achieve a 3D-like effect with spritebatch's rotation and scale parameters
I'm working on a 2d game with a top-down perspective similar to Secret of Mana and the 2D Final Fantasy games, with one big difference being that it's an action rpg using a 3-dimensional physics ...
0
votes
1answer
107 views
Artifacts when using SamplerState.LinearClamp in SpriteBatch
I'm using XNA 4.0 and VS2010 Express for Windows Phone and Windows Phone SDK 7.1.
This is a platform game and I have a map made up of 16x16 textures that is drawn dynamically, tile by tile.
When ...
0
votes
3answers
201 views
Sprite batching seems slow
I have implemented a sprite batching system in OpenGL which will batch sprites based on their texture. However, when I'm rendering ~5000 sprites all using the same texture I'm getting roughly 30fps.
...
1
vote
1answer
147 views
Edge flicker when moving Camera (2D)
I have a Orthographic camera. I have a fixed landscape texture and a texture for a moveable object.
If the object moves to the right the camera will also move with the object.
When I also draw an ...
0
votes
2answers
263 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
1answer
364 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 < ...
2
votes
0answers
272 views
Using SpriteBatch with BasicEffects and layerDepth creates negative Z values?
Simply: Why don't all of these sprites draw? What do I need to do to make them draw?
I'm trying to use SpriteBatch.Draw with the layerDepth parameter to help reduce overdrawn. However I can't get it ...
2
votes
1answer
344 views
XNA how to draw some sprites tiled/wrapped and others not?
I already have:
mySpriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend);
and take care to draw all my sprites in order.
I now want to draw some textures tiled. Do I have to create ...
1
vote
3answers
266 views
Smallest increment for a SpriteBatch depth between 0.0 and 1.0?
I experienced some problems with SpriteBatch in XNA when I tried to mix two different SpriteSort modes. (Begin with deferred, end, begin with BackToFront wasn't sorting properly.) I've settled on just ...
1
vote
0answers
149 views
SharpDX's ContextDirect2D Begin/Draw/End vs SpriteBatch
I'm migrating from XNA to SharpDX in Win8. I noticed this in one of the samples: http://sharpdx.org/documentation/api/m-sharpdx-direct2d1-devicecontext-drawbitmap. Is this different in some shape way ...
5
votes
3answers
303 views
What is the technical definition of Sprite Batching?
Platform and language agnostically, how is sprite batching defined? It seems as though there are many different techniques for lessening the amount of work when drawing, and that they are often lumped ...
1
vote
1answer
415 views
SpriteBatch.Begin() making my model not render correctly
I was trying to output some debug information using DrawString when I noticed my model suddenly was being rendered like it was inside-out (like the culling had been disabled or something) and the ...
1
vote
0answers
137 views
Sprite sorting issues
I apologize for the vague title, I'm not sure how else to phrase this problem.
I am using tIDE to assist me in my game's world development. To give a dynamic effect to map layers within tIDE, it has ...
0
votes
0answers
120 views
Batched texture filled polygon on Cocos2d
Does anyone have any code that makes Cocos2D render a texture filled polygon inside a batch node?
The code posted here does a nice job rendering a texture filled polygon but the class doesn't work ...
3
votes
2answers
417 views
XNA 4.0 SpriteFont not displaying all Characters
Am looking for a little help and trying to use SpriteFont in my XNA 4.0 game but the problem is am displaying to string "This is a test" but all that's displayed on the screen is "This is st" so ...
0
votes
1answer
257 views
Nested Sprite Batch and background draw
my code looks something like this:
graphicsDevice.Clear(Color.Black);
spriteBatch.Begin();
spriteBatch.Draw(contentLoader.VerticalGradient, tileSafe, null, ...
3
votes
2answers
406 views
Cropping a line (laser beam) in XNA
I have a laser sprite that I wish to crop. I want to crop it so when it collides with an item, I can calculate the distance between the starting point, and the ending point, and only draw that. This ...
3
votes
2answers
345 views
2D sprites not drawing at correct depths?
I've been having some problems with getting my sprites to draw in the correct order.
Right now there are 2 types of objects: nodes and paths. I always want the nodes to draw over the paths so I have ...
-2
votes
1answer
117 views
Sprite Sheet for Musical Notes?
Does anybody know of a sprite sheet of musical notes (half note, minim)? I am trying to draw musical notes onto an android canvas.
-4
votes
1answer
266 views
Make Sprite Jump Upon a Platform
I have been struggling to make a game like Doodle Jump where the sprite jumps on a platform. So how do you make a sprite jump upon platforms in XNA? Th platforms are represented by a list of positions ...
4
votes
4answers
1k 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 {
...
2
votes
2answers
392 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
1answer
267 views
XNA GameServices vs. public static
I am just starting learning XNA for developing Windows Phone games. I am stumbling accross different sample codes featuring different approaches on handling things.
A question for the experts... or ...
1
vote
3answers
999 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 ...
4
votes
4answers
1k views
How to clip cut-off text in a textbox?
I'm writing a textbox class for my XNA game and I'm using SpriteFont to draw the text. It's only a single line textbox so when the text width exceeds the size of the rectangle box, it currently just ...
2
votes
1answer
909 views
Why isn't my sprite being drawn in the correct position in XNA?
Sorry if this has been asked before, but I can't seem to find it here. I'm trying to make an asteroids clone in XNA. I took the Game State Management project and am making new classes for things like ...