Reply
Thread Tools Display Modes
Unread 04-26-10, 03:24 PM   #21
TravisWatson
A Deviate Faerie Dragon
Join Date: Apr 2010
Posts: 11
Originally Posted by Sideshow View Post
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.

Last edited by TravisWatson : 04-26-10 at 03:28 PM.
TravisWatson is offline   Reply With Quote
Unread 04-26-10, 03:39 PM   #22
Sideshow
A Warpwood Thunder Caller
 
Sideshow's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 99
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'
__________________
Sideshow is offline   Reply With Quote
Unread 04-26-10, 03:41 PM   #23
TravisWatson
A Deviate Faerie Dragon
Join Date: Apr 2010
Posts: 11
Originally Posted by Sideshow View Post
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.
TravisWatson is offline   Reply With Quote
Unread 04-26-10, 03:44 PM   #24
Sideshow
A Warpwood Thunder Caller
 
Sideshow's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 99
Originally Posted by TravisWatson View Post
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...
__________________
Sideshow is offline   Reply With Quote
Unread 04-26-10, 04:01 PM   #25
TravisWatson
A Deviate Faerie Dragon
Join Date: Apr 2010
Posts: 11
Originally Posted by Sideshow View Post
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.
TravisWatson is offline   Reply With Quote
Unread 04-26-10, 04:47 PM   #26
Sideshow
A Warpwood Thunder Caller
 
Sideshow's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 99
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...
__________________
Sideshow is offline   Reply With Quote
Unread 04-27-10, 07:34 AM   #27
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 714
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)?
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
nightcracker is offline   Reply With Quote
Unread 04-27-10, 08:24 AM   #28
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
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.
__________________
I have very little time to play WoW and even less time to code addons. As such I've dropped all development of all my addons. If you want to continue any addon or make a fork then feel free to do so. This is your permission slip.

Best regards, Valle.

Last edited by v6o : 04-27-10 at 08:39 AM.
v6o is offline   Reply With Quote
Unread 05-10-10, 02:17 AM   #29
Sideshow
A Warpwood Thunder Caller
 
Sideshow's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 99
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.
__________________
Sideshow is offline   Reply With Quote
Unread 05-10-10, 12:50 PM   #30
TravisWatson
A Deviate Faerie Dragon
Join Date: Apr 2010
Posts: 11
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.
TravisWatson is offline   Reply With Quote
Unread 05-12-10, 01:28 AM   #31
Wella
A Rage Talon Dragon Guard
 
Wella's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 322
Originally Posted by TravisWatson View Post
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. :/
__________________
Addons I use, not that any of you care
* Bejeweled - For boring 5 minute flights to Tanaris
* Genie - Blizzard really should have implemented bag sorting by now
* ncHoverBind - I'm a Lock, what can you expect?
* oGlow - Agan, a missing feature
* Recount - Derp
* ShooShards - Another missing feature


"Your idea is good. So i will try it."
- popmissa
Wella is offline   Reply With Quote
Unread 05-12-10, 03:09 AM   #32
MidgetMage55
Grinch!
 
MidgetMage55's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,498
I wasn't aware Dominos had a sexual preference.
__________________

I think Hong Kong Phooey was a ninja AND a pirate. That was just too much awesome. - Yhor
MidgetMage55 is offline   Reply With Quote
Unread 05-12-10, 07:05 AM   #33
TravisWatson
A Deviate Faerie Dragon
Join Date: Apr 2010
Posts: 11
Originally Posted by MidgetMage55 View Post
I wasn't aware Dominos had a sexual preference.
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).
TravisWatson is offline   Reply With Quote
Unread 05-12-10, 07:11 AM   #34
voodoodad
Large, Friendly Letters!
 
voodoodad's Avatar
Join Date: Oct 2008
Posts: 1,632
Originally Posted by MidgetMage55 View Post
I wasn't aware Dominos had a sexual preference.
mmmmmm... new improved Dominos...

Wait, does this make me GAY?!?

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

~ no need to make the message completely obnoxious - Cairenn
voodoodad is offline   Reply With Quote
Unread 05-12-10, 02:13 PM   #35
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,051
Originally Posted by voodoodad View Post
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?
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of Revelation, Spamalyzer, TravelAgent, Volumizer, and many other AddOns.
Torhal is offline   Reply With Quote
Unread 05-12-10, 02:15 PM   #36
Wella
A Rage Talon Dragon Guard
 
Wella's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 322
Originally Posted by TravisWatson View Post
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.
__________________
Addons I use, not that any of you care
* Bejeweled - For boring 5 minute flights to Tanaris
* Genie - Blizzard really should have implemented bag sorting by now
* ncHoverBind - I'm a Lock, what can you expect?
* oGlow - Agan, a missing feature
* Recount - Derp
* ShooShards - Another missing feature


"Your idea is good. So i will try it."
- popmissa
Wella is offline   Reply With Quote
Unread 05-12-10, 04:12 PM   #37
voodoodad
Large, Friendly Letters!
 
voodoodad's Avatar
Join Date: Oct 2008
Posts: 1,632
Originally Posted by Wella View Post
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.

Originally Posted by Torhal View Post
Find her a girlfriend?
That's not a bad.... HEY!!!
__________________

~ no need to make the message completely obnoxious - Cairenn
voodoodad is offline   Reply With Quote
Unread 05-12-10, 10:30 PM   #38
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,051
Actually, I'll illustrate:

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

This doesn't work!
...as in, none whatsoever.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of Revelation, Spamalyzer, TravelAgent, Volumizer, and many other AddOns.
Torhal is offline   Reply With Quote
Unread 05-13-10, 05:44 AM   #39
voodoodad
Large, Friendly Letters!
 
voodoodad's Avatar
Join Date: Oct 2008
Posts: 1,632
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.
__________________

~ no need to make the message completely obnoxious - Cairenn

Last edited by voodoodad : 05-19-10 at 09:50 AM.
voodoodad is offline   Reply With Quote
Unread 05-19-10, 06:47 AM   #40
Wella
A Rage Talon Dragon Guard
 
Wella's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 322
Pedantry is not funny.
__________________
Addons I use, not that any of you care
* Bejeweled - For boring 5 minute flights to Tanaris
* Genie - Blizzard really should have implemented bag sorting by now
* ncHoverBind - I'm a Lock, what can you expect?
* oGlow - Agan, a missing feature
* Recount - Derp
* ShooShards - Another missing feature


"Your idea is good. So i will try it."
- popmissa
Wella is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » Tutorials & Other Helpful Info. » Pixel Perfection for Specific Resolution

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off