Questions tagged [spritebatch]
A group of sprites that can all be drawn with the same settings
122 questions
0
votes
1
answer
407
views
2D Batching and correct draw order
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 ...
3
votes
1
answer
78
views
Spritebatch drawing the other way
I am drawing a rectangle using a emptytexture (1x1) and I use the following:
...
0
votes
1
answer
462
views
How to flip a rectangle
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 ...
0
votes
1
answer
143
views
XNA's SpriteBatch resizing is not sharp as i use it [duplicate]
I draw a TiledMap with TiledSharp and i've introduced a resize factor when drawing, that looks like this:
...
0
votes
0
answers
191
views
DirectXTK: SpriteBatch::Begin and Draw methods give LNK2019: unresolved external
Right now, im using DirectXTK (version 2020.2.24.4) and Visual Studio 2019.
My declarations look like this:
...
0
votes
1
answer
429
views
In Monogame, can/should SpriteBatch be instantiated in the Initialize method as opposed to the LoadContent method?
By default the SpriteBatch instance used is instantiated in the LoadContent method of Game1.
...
0
votes
1
answer
210
views
Aligning animation frame assets with different sizes
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 ...
0
votes
1
answer
300
views
How to render a trimmed sprite?
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 ...
2
votes
1
answer
911
views
Overlaying Menus with a State Machine
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 ...
3
votes
1
answer
2k
views
How to use multiple shaders with LibGdx + SpriteBatch
I'm programming a 2D game libgdx. I'm using a SpriteBatch of course to draw some Sprites. Now I wanted to use multiple ...
1
vote
1
answer
455
views
Removing/Updating Spritebatch
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 ...
1
vote
1
answer
686
views
Using 60 frames per second causes the screen to leave a drawn trail of textures, when there is movement
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 ...
0
votes
1
answer
359
views
Rendering multiple strings/text using SpriteBatch from LibGDx library
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 ...
1
vote
0
answers
127
views
How can I draw a snapshot of the game within the game?
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'...
0
votes
1
answer
171
views
Drawing a partial sprite with batch-LibGdx
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:
...