I am having some problems with my 2d textures in XNA. For some reason the quality is coming out all blury. I am using PNG format files for this. Is there anything obvious that may be making it blury?
Printable View
I am having some problems with my 2d textures in XNA. For some reason the quality is coming out all blury. I am using PNG format files for this. Is there anything obvious that may be making it blury?
Are you scaling the textures? Have you made sure that they are drawn with the scale 1.0f?
Where about's would this be done?
When you draw the texture using the SpriteBatch there's an overload that lets you set the scale as a floating point number, where 1.0f would be original scale.
Ok would it go in this line?
Code:MainSB.Draw(Textures("Frame"), FrameRect, Color.White)
Yeah, it appears as if you are not using the overload that sets the scale..so it should default to 1.0f. But still, try explicitly setting the scale to 1.0f by using an appropriate Draw overload.
To be honest I don't really know what you mean by draw overload. Could you explain an maybe give an example?
Try something like this:
Code:MainSB.Draw(Textures("Frame"), FramePosition, null, Color.White, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 1)
Where FramePosition is a Vector2 denoting the position of the texture. Try that.
Ok when using that I am getting the following error:
Quote:
'Null' is not declared. 'Null' Constant is no longer supported, use 'system.DBnull' instead
Ah yes, you appear to be using VB.NET, use Nothing instead.
Ok that work's without any errors but doesn't solve problem it seems a bit more clearer but it is not the original size i created it. Maybe if i post some screen shots. The left image is what it looks like rendered and the right is the original image created in photoshop.
Try this. Double the size of your texture images in Photoshop, then in the game, apply a 0.5 scale to them. They should retain more of their crispness.
Also, let me look at how to tell XNA to turn on anisotropic filtering. This will definitely help your texturing issues.
I have tried that and for some reason it wasn't drawing it to half the size it was stretching the width out. I don't really understand why it's doing this as i'm not doing anything different to the last game and that textured came out perfect on there.
By the way still haven't got the installer to work on the last game. If I open the exe from the prject file it works fine but if i create an installer using the exe file it brings up the windows error message.
Not having much luck with XNA :(
Ok problem solved. In my first game the graphics were done in Photoshop CS2 and in this I did them in Photoshop 7. I have re-installed CS2 and redone the graphics and for some reason they now look fine.
Weird. PS7 must have done something funky with anti aliasing.