WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Tutorials & Other Helpful Info. (https://www.wowinterface.com/forums/forumdisplay.php?f=12)
-   -   Pixel Perfection for Specific Resolution (https://www.wowinterface.com/forums/showthread.php?t=31813)

TravisWatson 04-26-10 03:24 PM

Quote:

Originally Posted by Sideshow (Post 186019)
You say SetCVar / GetCVar ??? I corrected it to GetCVar / GetCVar

You are incorrect by changing this code to use 2 GetCVars, since there are two arguments in nightcracker's code, and GetCVar only has one argument:

http://wowprogramming.com/docs/api/GetCVar

I also don't agree with nightcracker's original code either (and this may be simply a misunderstanding on my part as well). It seems like the multiplier calculation should only call GetCVar:

Code:

local mult = (768/string.match(({GetScreenResolutions()})[GetCurrentResolution()], "%d+x(%d+)"))/GetCVar("uiScale")
His original code, if I understand it correctly, would override your UIScale Cvar permanently with a fixed value.

Anyways, the premise to this method is finding the reverse multiplier that WoW is using, so it is scaling you one way, and you're scaling it back before you draw, thereby negating effects of both the UI scaling and the "in-game" resolution based off a 768 pixel height screen.

I'm still going to reiterate this warning: using this method will cause the code ignore UI scaling. Use only where appropriate.

For instance, a 1 pixel border ignoring UI scale is fine, as it will stretch to encompass the entire container and still serve its purpose while retaining is pixel perfection. Using it to scale an entire frame will result in the UI enlarged or contracted in comparison to your addon because your addon isn't scaling with everything else.

Sideshow 04-26-10 03:39 PM

Ok, then I can't use the scale function. I'm still not sure which code to actually use then, which would be useful. Probably the stuff by Saiket. But that code is kind of 'littered' :o

TravisWatson 04-26-10 03:41 PM

Quote:

Originally Posted by Sideshow (Post 186027)
I'm still not sure which code to actually use then

If you can explain a little more on what you're trying to do, it would be easier to offer guidance.

Sideshow 04-26-10 03:44 PM

Quote:

Originally Posted by TravisWatson (Post 186029)
If you can explain a little more on what you're trying to do, it would be easier to offer guidance.

My addon has a 1 pixel main frame border, and contains a lot of bars, which are all on 1 pixel distance from the mainborder...

TravisWatson 04-26-10 04:01 PM

Quote:

Originally Posted by Sideshow (Post 186030)
My addon has a 1 pixel main frame border, and contains a lot of bars, which are all on 1 pixel distance from the mainborder...

You can try night's suggestion, but like I said, just looking at the code, it appears as if it's setting the uiScale, which it should not do.

You can try with my modification as well:

Code:

local mult = (768/string.match(({GetScreenResolutions()})[GetCurrentResolution()], "%d+x(%d+)"))/GetCVar("uiScale")
local function scale(x) return mult*x end

someframe:SetHeight(scale(10))
someframe:SetWidth(scale(10))

Once I get off work, I'll test this and investigate a bit further. Anyone else is welcome to provide insight.

I agree that Saiket's code is geared more towards a specific purpose, so it's going to be a little obfuscated.

Sideshow 04-26-10 04:47 PM

Heh, thanks. Have a look at this screenshot. On the topright, you'll see the addon I'm working on.

http://img651.imageshack.us/img651/2...210011038h.jpg

For now, it's always pixelperfect with the manual /run thingy...

nightcracker 04-27-10 07:34 AM

Can anyone give some enlightment on this:

Is there ANY way to get the UI Scale of the user BEFORE any loading progress event(PLAYER_ENTERING_WORLD, VARIABLES_LOADED, etc)?

v6o 04-27-10 08:24 AM

I don't think there is. The default UI waits until it's available (VARIABLES_LOADED) before setting the scale on UIParent but as this happens during the loading screen or loading progress, no one notices the scaling happening.

Sideshow 05-10-10 02:17 AM

I still did not find a suitable solution.

I've looked into the scripts here, the problem is that if you use such a script, the addon does not scale anymore with the UIscale but uses a fixed scale at all times. It also gives a weird effect if your addon IsSizable() and the user tries to resize it....

I think the easiest way is just to tell people to use the manual /run SetCVar() if they want to use an UIscale and not have a problem with pixels.

TravisWatson 05-10-10 12:50 PM

Can anyone who's used this method before successfully share a demo? I too, tried this out and was unable to get it to perform correctly.

What I want to see is a scalable and movable frame whose borders and size always break on "real" pixels rather than in-game pixels regardless of scale or position.

Wella 05-12-10 01:28 AM

Quote:

Originally Posted by TravisWatson (Post 187629)
What I want to see is a scalable and movable frame whose borders and size always break on "real" pixels rather than in-game pixels regardless of scale or position.

Agree.

Also, Dominos is gay for getting pixel-perfect borders, especially with PixelSkin for ButtonFacade. I might try out a different AB mod just because of this. :/

MidgetMage55 05-12-10 03:09 AM

I wasn't aware Dominos had a sexual preference. :rolleyes:

TravisWatson 05-12-10 07:05 AM

Quote:

Originally Posted by MidgetMage55 (Post 187819)
I wasn't aware Dominos had a sexual preference. :rolleyes:

I think I could be gay for Dominos. <3

If you want your whole UI to be perfect, check out the first post in this thread (that includes Dominos if you leave it on 100% scale).

voodoodad 05-12-10 07:11 AM

Quote:

Originally Posted by MidgetMage55 (Post 187819)
I wasn't aware Dominos had a sexual preference. :rolleyes:

mmmmmm... new improved Dominos...

Wait, does this make me GAY?!?

Oh, man! How'm I gonna break this to my girlfriend?

Torhal 05-12-10 02:13 PM

Quote:

Originally Posted by voodoodad (Post 187834)
mmmmmm... new improved Dominos...

Wait, does this make me GAY?!?

Oh, man! How'm I gonna break this to my girlfriend?

Find her a girlfriend?

Wella 05-12-10 02:15 PM

Quote:

Originally Posted by TravisWatson (Post 187832)
If you want your whole UI to be perfect, check out the first post in this thread (that includes Dominos if you leave it on 100% scale).

I said that Dominos was being gay because it seemed to be unaffected by this. Well, to a degree. Whatever.

voodoodad 05-12-10 04:12 PM

Quote:

Originally Posted by Wella (Post 187883)
I said that Dominos was being gay because it seemed to be unaffected by this. Well, to a degree. Whatever.

You see, Wella, most people on this website try to avoid using the term "gay" as a descriptor for things they don't like the visual presentation or functionality of. Instead, we attempt to use language that actually describes what we like or don't like about any given addon or ui. Simply calling something gay is kinda considered old-school (or dare I say, gauche) in this neck of the woods.

Quote:

Originally Posted by Torhal (Post 187882)
Find her a girlfriend?

That's not a bad.... HEY!!!

Torhal 05-12-10 10:30 PM

Actually, I'll illustrate:

Quote:

This is gay.
That phrase relays exactly the same amount of information as:

Quote:

This doesn't work!
...as in, none whatsoever.

voodoodad 05-13-10 05:44 AM

In other words, whenever someone says "gay" because it's shorter than "this is not working correctly, and here's what it's doing wrong...", I say "I can't help you." because it's shorter than explaining that it's working correctly but the user just doesn't know what they're doing. :D

Wella 05-19-10 06:47 AM

Pedantry is not funny.


All times are GMT -6. The time now is 05:54 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI