I am trying to make a simple click function. The client is resizable(though often widescreen), while the actual clickable area is fullscreen(4:3). I want to make mouseclicks able to be done in %, but I can't figure out a formula to allow the window to be any size while still being able to achieve successful clicks in the locations I need
I currently have something like this
$Title = WinGetHandle("Untitled")
Dim $Size = WinGetClientSize($Title)
Dim $Pos = WinGetPos($Title)
$Pos[1] = $Pos[1] + 25
Dim $Offset = ($Size[0] - (($Size[1]-25)*(4/3)))/2
$Size[0] = $Size[0]-($Offset*2)
MsgBox(1,"asd",$Offset & " || " & $Size[0] & " || " & $Size[1] & " || " & $Pos[0] & " || " & $Pos[1])
MouseClick("Left", $Pos[0]+$Offset+(0.70*$Size[0]), $Pos[1]+(0.17*$Size[1]))
Offset being the empty white bar you'd get on each side, I attempted to add the offset to the relative X position of the window, to get the start of the playable area for horizontal. Relative Y position, +25 for titlebar, for Y.
The code I have here is pretty close but it doesn't quite do it. It ends up being a dozen pixels off or so when i start stretching it a good chunk. I need it to be pretty precise(not necessarily perfect) as I want to use some pixelsearch and whatnot as well, but a couple dozen pixels is too much. The border window of the window is causing some issues in the formula, but I don't want to remove it if possible.
I would like help in refining or remaking this formula to function more accurately.