How to make pixel-accurate interface?
I am trying to output some pixels and have two problems.
1. Frame:SetSize(x, y) in real pixels is not exactly x and y. I can compensate it by using Frame:SetScale(768/real_resolution). But how can I get <real_resolution> within addon? 2. I cannot set exact pixel color. I have Code:
function SetColor256(obj, r, g, b) |
|
Quote:
and Check out oUF p3lim |
Most of the sub pixel issues in wow stem from loss of precision on frame dimensions & position, check the actual position and size of whatever you're having issues with, most likely there will be floating point errors, textures will go through the filter if they are not correctly positioned & scaled.
the issue is most noticeable in text (as text does not filter, it just floors the position). for example, take the ElvUI options window (or any frame with a lot of text anchored to it) and drag it around slowly, you'll notice the text shifts up & down. then increase the width & height of the frame by 0.01, and you'll notice the text stops wiggling and all the textures sharpen up. It's also worth mentioning that you can put your textures and shit directly in WorldFrame to avoid ui scaling. |
Tnank you for answers, the problems were solved:
1: By using GetPhysicalScreenSize() 2: By using the following code: Code:
local function SetColor256(obj, r, g, b) |
From https://github.com/p3lim-wow/Inomena...er/scaling.lua
Lua Code:
|
All times are GMT -6. The time now is 04:08 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI