Hey DiGiTal
Summary:
Y axis: Y axis position & compute pixel density(scale)
X axis: X axis position
drawText("$123456789", 140*sx, 648*sy, 0*sx, 0*sy, tocolor(0,0,0,255), 0.8*sy,"bankgothic")
drawText("$123456789", <start position>, <start position>, <end position>, <end position>, tocolor(0,0,0,255), <scale>,"bankgothic")
Take a look at your code. There are 3 types of arguments.
start position (boundingbox)
x
y
end position (boundingbox)
x
y
scale (text)
And an `invisible` one, which is the boundingbox size:
boundingbox width = (end position x) - (start position x)
boundingbox height = (end position y) - (start position y)
You are currently not using the boundingbox. But that is something you could scale as well.
When scaling and positioning, there is 1 important thing to keep in mind and that is to look at both of them differently. Because for some cases you want to scale position over the X and Y axis at the same time.
X axis is used for the raw position.
Y axis is used for the offset.
local scaleValueY = sy_/900
local startPositionX = x_ -- right side of the screen
local offsetX = scaleValueY * 30 -- calculate an scaled offset value
local positionX = startPositionX - offsetX
Your code
drawText("$123456789", 140*sx, 648*sy, 0*sx, 0*sy, tocolor(0,0,0,255), 0.8*sy,"bankgothic")
=
drawText("$123456789", <10.2%>, <72%>, <0%>, <0%>, tocolor(0,0,0,255), <80% * 100%>,"bankgothic")
I assume this is text placed above the radar.
Now how to figure out the difference in methods?
The only way is actually to see it for yourself.
I made the following changes to reproduce your situation:
Argument 2: Scaling the left offset over the Y axis.
Argument 3: Starting from bottom to top, to improves `value` readability. (but doesn't change the outcome)
Changed the text color to red.
local scaleValueY = sy_/900
drawText("$123456789", scaleValueY * 140, sy_ - (scaleValueY * 252), 0, 0, tocolor(255,0,0,255), 0.8 * scaleValueY,"bankgothic")
Your development resolution is: 1440 x 900
Check if both of them are aligned properly.
If yes, then:
Run both of examples at the same time with different resolutions and ratio aspects.
Check the X position of both methods and see how those behave.
Make some screenshots, which we can discus here.