Quantcast WoWInterface - View Single Post - How does WoW manage decimal point on "SetPoint", "SetSize" and so on?
View Single Post
10-11-17, 02:23 PM   #13
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,289
Originally Posted by semlar View Post
When I made pixel perfect nameplates some years ago, rather than anchor my frame to the existing nameplates I manually calculated their offset relative to the WorldFrame and moved them OnUpdate (later I realized I could do this in response to the nameplate movement instead).



The forum resizing this image is a perfect example of what the game is doing when it blurs your texture by scaling it for the client's window.

There are 2 factors that come into play if you want to prevent the game from blurring your textures:

1) The size/scale of your image on the screen needs to exactly counter any scaling the client is doing to draw it in the window.

2) The offset of the edge of the texture on screen needs to fall on what I generally refer to as a pixel boundary. In other words, the top left (or any edge) of the texture should be aligned with the grid of pixels on screen; if it falls between them the game will round it in either direction and skew your texture.

You need a function to calculate what size your texture should be, but you also need one to calculate the proper offset for your anchors.
The problem with this is extremely hard to do if you have no clue what are you doing, and it can also take up a lot of resources. I think the game engine should do this by itself and it should do it a lot better then the current anchoring system. Anything that is not a 3D object should be rounded to pixel perfect by default.

Another good example when the GameTooltip border gets screwed, that's also caused by the wrong positioning anchor values.
  Reply With Quote