Skip to main content

Questions tagged [spritebatch]

A group of sprites that can all be drawn with the same settings

Filter by
Sorted by
Tagged with
0 votes
1 answer
404 views

I'm encountering a design challenge while developing my 2D C++ OpenGL engine. I'm using a batching technique for rendering my drawable objects, and I want to ensure they are drawn in the same order ...
DDD's user avatar
  • 11
3 votes
1 answer
78 views

I am drawing a rectangle using a emptytexture (1x1) and I use the following: ...
Alanus Ger's user avatar
0 votes
1 answer
462 views

I'm curently working on a system that make the player character look towards the mouse pointer. My system is effective but i'm having an issue while displaying the rectangle. In the Following code i ...
Loé B.'s user avatar
  • 35
0 votes
1 answer
143 views

I draw a TiledMap with TiledSharp and i've introduced a resize factor when drawing, that looks like this: ...
Loé B.'s user avatar
  • 35
0 votes
0 answers
191 views

Right now, im using DirectXTK (version 2020.2.24.4) and Visual Studio 2019. My declarations look like this: ...
Goldy's user avatar
  • 1
0 votes
1 answer
428 views

By default the SpriteBatch instance used is instantiated in the LoadContent method of Game1. ...
Steven's user avatar
  • 3
0 votes
1 answer
209 views

I have code that changes texture in each frame depending on the player's state - walking, idle. My problem is that the idle texture (from separate png) has a slightly different size, and due to that ...
new User's user avatar
0 votes
1 answer
299 views

I used TexturePacker to create an atlas for me and I've read it into my game. I can use unrotated and untrimmed sprites and it works fine. Now I would like to support trimmed sprites and I'm running ...
101010's user avatar
  • 209
2 votes
1 answer
910 views

I'm working on developing a game with C++, SDL, and OpenGL. I created the engine from scratch, and implemented my own state machine to handle menus and general gameplay. Each State gets pushed into a ...
MathPRG's user avatar
  • 23
3 votes
1 answer
2k views

I'm programming a 2D game libgdx. I'm using a SpriteBatch of course to draw some Sprites. Now I wanted to use multiple ...
mrdlink's user avatar
  • 31
1 vote
1 answer
454 views

I am designing a Spritebatch class, for static and dynamic objects with WebGL. A problem I'm facing is that I have read several different opinions on sprite batching but with one goal. Put all ...
greedsin's user avatar
  • 118
1 vote
1 answer
686 views

I'm trying to implement a frame rate feature, and I have noticed that using 60 frames per second causes the screen to leave a drawn trail of textures, when there is movement. Here's the code I'm ...
Daniel's user avatar
  • 11
0 votes
1 answer
358 views

I am using the LibGDX library to render a 3D model in my Android application. Now, I am stuck, where I want to render multiple dynamic texts on to different 3D boxes located on different coordinates ...
Ankit Gupta's user avatar
1 vote
0 answers
127 views

I'm making a game in libGDX wich the main focus is "recursion", so I can play multiple instances of the game in itself, flowing through "layers" of games. Currently its mechanics work perfectly, but I'...
vilok600's user avatar
0 votes
1 answer
171 views

I have a sprite like this. I want to draw this sprite in such a way that sprite is growing from bottom to top, using sprite batch on tap.for that,I have written the following code: ...
Niranjana's user avatar
  • 123
1 vote
2 answers
3k views

When I am using the same spritebatch to draw texture and calling shaperenderer inside it, it is kind of misbehaving, like texture is not getting drawn or font is not getting drawn, Why is it happening?...
Vamsi Rao's user avatar
0 votes
1 answer
537 views

I'm wondering what is more performance friendly: 1) Rendering a texture (in a seperate RenderTarget2D) and reuse it. (That will use multiple spriteBatch.End() / <...
TheRealVira's user avatar
3 votes
0 answers
293 views

I have a weird problem with my hexmap drawing code. My code uses "squished" hexagons to achieve a pseudo-isometric view. Because of that, the order of drawing them on screen matters a lot. ...
Daniel Tyomin's user avatar
0 votes
1 answer
545 views

I have been trying to position my spritebatch correctly regardless of screen size but it simply wont scale..This is what I want to achieve on every screen size..I want my Sprite Object to be ...
Bmbariah's user avatar
  • 103
3 votes
1 answer
5k views

I'm talking about the public void Draw (Texture2D texture, Vector2 position, Nullable sourceRectangle, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth)...
Giora Guttsait's user avatar
1 vote
1 answer
133 views

I have created a little game using LibGDX and it uses a SpriteBatch when it renders the game objects. Now I want to add a Touchpad to it, and the draw method of Touchpad takes a Batch as a parameter, ...
Florin's user avatar
  • 11
1 vote
1 answer
1k views

It looks like semitransparent pixels are blended with while color when textures are drawn scaled. It is very noticeable and looks ugly when textures are drawn on dark background. ...
therainycat's user avatar
1 vote
1 answer
1k views

I've reached a point that it seems when I draw too much on screen, monogame starts doing weird things. When I call this code in the Draw method ...
user avatar
0 votes
1 answer
264 views

I've watched some tutorials on java game development and when they start using spritesheets all they do is get a subimage out of the spritesheet and create a new BufferedImage out of that. Does java ...
user avatar
1 vote
1 answer
2k views

for a university project we are creating a small "2d" game. Im writing 2D in "" because we would like to achieve a look similiar to the one in games like Don't Starve (so more like 2.5D). As you ...
shniqq's user avatar
  • 46
0 votes
1 answer
488 views

I'm using LibGDX and the SpriteBatch and ShapeRenderer are having a perspective problem or something... When I draw something with both (code below), the planet texture is smaller than it should be. I ...
Jason's user avatar
  • 1
3 votes
3 answers
894 views

I mean, I want to make a tiled map using scene2d, so in the render method of my game... ...
Asaltaviejas's user avatar
2 votes
1 answer
164 views

I started developing a small cross platform game engine using OpenGL, I am working actually on a sprite batch renderer. Everything is working fine on OS X, iOS, Win32, and some Android Devices. Here ...
Mehdi's user avatar
  • 121
0 votes
1 answer
115 views

I have a static class that I use to build a 3d character and render the results to a RenderTarget2D which I then return. I'd like to store the results for later use so I need to make a copy of the ...
Stoort's user avatar
  • 86
4 votes
1 answer
930 views

I'm working on a 2D sidescroller within Unity 5.1. The terrain is intended to be semi-infinite in all 4 directions, procedurally generated using a noise algorithm. I'm using a 3x3 grid of quads as "...
Mythics's user avatar
  • 1,486
1 vote
1 answer
895 views

I'm making a game with Libgdx 1.6.4 and experience some lag issues on iPhone 4 and then discovered: ...
luben's user avatar
  • 299
0 votes
1 answer
882 views

I'm currently struggling with finding the offset for my original camera translation after I have applied a rotation for it. ...
Razeal's user avatar
  • 83
0 votes
1 answer
119 views

here is the code: ...
yaakov rubenchik's user avatar
3 votes
1 answer
3k views

I am attempting to use the following code ...
Ayman's user avatar
  • 275
1 vote
0 answers
309 views

I am working on my first game with LibGDX and coming from ActionScript3 I am used with the possibility of scaling things more or less the way I want. I know it works different in LibGDX, but I can't ...
Petre Popescu's user avatar
1 vote
1 answer
3k views

I'm new to game dev and using SFML. I need to use lots of sprites at the same time, so I will probably need sprite batching. I know that sprite batching is used to draw multiple sprites with a single ...
as96it's user avatar
  • 21
0 votes
1 answer
604 views

I'm trying to port a blur effect from an XNA project over to SharpDx, and I get a "Null Reference Exception" wich I'm unable to find the reason for. ...
danbystrom's user avatar
3 votes
2 answers
185 views

I would like to use a custom effect with a regular XNA SpriteBatch. I have a 2D camera which computes a transform matrix, so I need my shader to take this into ...
dfgdhdgh's user avatar
5 votes
1 answer
762 views

The problem: I can't fit all my 2d animation sprites for all units and environment in 1 spritesheet. Everything batches fine until I use two spritesheets... I noticed the following : all units from ...
Ruben O's user avatar
  • 81
2 votes
1 answer
2k views

I am using a SpriteBatch to render large amounts of sprites very fast. Now I want to modify the sprites with shaders to tint them in a color. Problem 1: Altering an uniform by getting the shader and ...
Benedikt S. Vogler's user avatar
2 votes
1 answer
164 views

Background: I'm working on a control library for XNA to use in a couple game clients I've written. The way I've implemented Dialogs is to have them derive from the base ...
E. Moffat's user avatar
  • 123
5 votes
2 answers
7k views

From other frameworks I know methods for easy ordering sprites within a spritebatch (to determine if a sprite has to be drawn in front or behind another sprite). For example in MonoGame/XNA this is ...
Sebastian's user avatar
  • 197
0 votes
1 answer
142 views

I'm trying to implement batching in my game (Sprite batching and 3D Mesh batching), I've read a lot of documentation about that but I don't understand something: When each object have is own ...
user30088's user avatar
  • 353
3 votes
1 answer
1k views

So I want my game to draw to a specific "optimal" size and then be stretched to fit screens that are a different size. I'm using LibGDX and figured that I could just draw everything to a FrameBuffer ...
StrongJoshua's user avatar
2 votes
4 answers
1k views

Please excuse my lack of knowledge with LibGDX, as I have just started learning it. I am going through some simple tutorials, and in one of them, I draw a string onto the screen like so: ...
just_a_programmer's user avatar
4 votes
1 answer
4k views

I'm using libGDX and currently have a simple shader that does a passthrough, except for randomly shifting the vertex positions. This shift is a vec2 uniform that I set within my code's render() loop. ...
midasmax's user avatar
  • 476
2 votes
1 answer
965 views

This my main draw call: ...
user avatar
1 vote
1 answer
2k views

Using libGDX, sprites or simply texture regions must be inserted into the batch for drawing: ...
felipe's user avatar
  • 397
0 votes
1 answer
269 views

My Problem is similar to XNA 4.0 - Why does using a RenderTarget2d cause transparency on models?. I want to render my scene to a Texture2D and then draw the texture. If I set no RenderTarget at all (...
FriendlyFruit's user avatar
0 votes
1 answer
1k views

I'm using SpriteBatch.DrawString, which seems to not have an overload for text alignment. How can I draw aligned text?
user3161621's user avatar