Sign in to follow this  

Pre-Sprite Scaling

This topic is 3572 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am making a game that the playfield is just on a single screen. No matter what the resolution the playfield should use up the screen space. Now I know how to do this but how can I do this efficiently? Basically scaling my sprites on every screen resolution change and saving them to use later. Thoughts? Next question is would it be worth it? All my sprite size and blt'ing code would also have to adjust. C#/XNA

Share this post


Link to post
Share on other sites
There's no need to scale your sprites. You can simply render all of your sprites to an off-screen render target, with that set to a resolution of your choice. Then, you can scale that render target to the target resolution of the screen or window. This will should allow you to handle arbitrary resolutions without adjusting any of your game logic and with minimal changes to your render path.

As for the syntax for doing this...you'll have to ask someone else as I'm not familiar with XNA.

Share this post


Link to post
Share on other sites
I know in OpenGL it was easy enough to specify the same orthographic dimensions for the viewport regardless of resolution, that way everything got scaled without an extra RTT and copy step.

Share this post


Link to post
Share on other sites
What I'm trying to do is to not have DirectX/XNA scale every frame. This would allow me to drop the hardware requirements significantly.

I haven't looked at the sprite stuff yet but scaling is something that's been bubbling in the back of my mind because I'm getting close. Initially I will just do ortho projection to 'get it working.'

Was just wondering if anyone else has done this and if there are any benefits.

Share this post


Link to post
Share on other sites

This topic is 3572 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this