Tagged Questions
9
votes
1answer
1k views
Xbox thumbstick used to rotate sprite, basic formula makes it “stick” or feel “sticky” at 90 degree intervals! How do you get smooth rotation?
I am using a very basic formula to calculate what angle my sprite (spaceship for example) should be facing based on the Xbox controller thumbstick i.e. you use the thumbstick to rotate the ship.
In ...
9
votes
2answers
5k views
How do I disable texture filtering for sprite scaling in XNA 4.0?
I have a sprite that I'm trying to scale up in XNA, but XNA is applying some sort of texture filtering that smooths it and makes it look ugly. I'd like it to just do pixel doubling instead of ...
9
votes
2answers
1k views
Scale my pixel art files when designing them or when rendering?
If I create pixel art files that need to be scaled up on the screen later, so that a single pixel becomes a box of 4 pixels. Should I create my pixel art with 2x2 pixels or should I create it with 1x1 ...
7
votes
1answer
399 views
Spritebatch drawing sprite with jagged borders
Alright, I've been on the making of a sprite class and a sprite sheet manager, but have come across this problem. Pretty much, the project is acting like so; for example:
Let's take this .png ...
6
votes
3answers
2k views
Is there a simple way to group two or more sprites, so all of them will be dependent on each other?
I think that this question is very similar to this one, but I'm not sure if the answers are universal.
So, my goal is:
Place two sprites in fixed position, for example player and his eyes
Make ...
5
votes
2answers
3k views
How do I access variables in the Game1 class from another class in XNA?
I'm trying to write a SpriteManager class in XNA, but I need access to the Game variables. For example, the Game.Content property would be very helpful in loading textures, and ...
5
votes
2answers
806 views
How to decompose sprite sheet
I have a lot of spritesheets that are poorly formatted that I want to decompose, or split out into many small images, one for each sprite.
If I can do that, I can use my custom texture packer tool to ...
4
votes
4answers
3k views
How to handle a Sprite Class?
Currently I am learning XNA and while playing around with some tutorials knowing what I am aiming for a game it made me think that the Sprite Class will be something very important and re-used a lot ...
4
votes
2answers
3k views
Clipping a SpriteBatch Draw() in XNA
Is there any way to enable a temporary clipping mask in XNA while using a SpriteBatch? I'm drawing a bunch of Texture2D objects and Sprites in a given rectangle, and I want to make sure that said ...
4
votes
2answers
865 views
snapping an angle to the closest cardinal direction
I'm developing a 2D sprite-based game, and I'm finding that I'm having trouble with making the sprites rotate correctly. In a nutshell, I've got spritesheets for each of 5 directions (the other 3 come ...
4
votes
1answer
930 views
Turning a sprite such that it rotates in the direction that's most efficient
I have a sprite that moves from waypoint to waypoint. It turns to face its velocity vector, but not instantly (there's a rotation speed).
The problem I'm having is, from one direction to another, the ...
4
votes
1answer
1k views
Mixing sprite drawing with 3D primitive drawing in XNA?
In my game, I have a base Note class, and various subclasses of Note. In addition, I have a NoteCollection class which contains a collection of these Note objects and draws them to the screen. ...
3
votes
2answers
600 views
SpriteSheet Animation with XNA
Hi i'm working on my First 2D Game with XNA and I have a little problem.
To give a running effect to my Sprite, I scroll through a SpriteSheet with this code(running right):
if (AnimationDelay == 6)
...
3
votes
1answer
1k views
How to “swing” bounding box and update collision for sprite swinging a weapon?
I have a simple question about sprite swinging weapons. I am making an RPG and would like something other than stabby-swords, so why not swinging swords?
I have a bounding rectangle for them, and the ...
3
votes
2answers
819 views
Sprite Animation in XAML/C# for Windows 8 Modern UI (Metro)
I'm working on a project that requires doing sprite based animation in XAML / C# for a windows store app. I've worked out a method for displaying the animation, but it causes flickering during the ...