• Advertisement
Sign in to follow this  

Converting 2D virtual coords to actual screen coords

This topic is 4495 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

Hi all, I have a custom GUI that I have been tinkering with. To make things 'simple' I have my GUI operate in a virtual resolution. That is to say, regardless of actual screen resolution my GUI -always- operates in an assumed 1024x768 2D resolution. Mapping from GUI coordinates to actual coordinate is trivial math. The problem comes in when my game runs in resolutions other than the GUI virtual resolution. For example, if my game runs in 800x600, some of my sprites have blurry edges, or look a pixel thinner/thicker than what you'd expect them to be. It's ESPECIALLY evident when rendering text. I also know exactly why this happens. Pixels in 1024x768 remapped to 800x600 may overlap more than one pixel when the conversion is complete. Similarly, 1024x768 to 1280x1024 may sometimes result in 'seams' and blurred edges as well. How can I get around this problem? Or is there an entirely different way of handling this? I'd like my GUI to function independant of actual screen resolution, but I'm not sure how get remap the coordinates 'cleanly.' Any help would be very much appreciated :) Grafalgar.

Share this post


Link to post
Share on other sites
Advertisement
The problem is that the texture rasterizer is doing its usual filtering, and for a GUI that requires lots of distinct edges for text and sprites it simply looks bad. The best solution is to have multiple versions of your sprite resources for different resolutions. While this is a bit more work, there really isn't any other good way to get around the limitations of the texture filtering.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement