|
Post by xxdxmhippiexx on Dec 15, 2016 14:38:16 GMT
I think i just thought of a fatle error in my RegionHelper script. ):
How it works. It gets the device's screen demintions then splits that up into 12 even regions. Each region is then divided up into 12 sub regions.
Then when a function is called it uses those to create the desired region, for example..
Reg:click("img", 3) This will click the image inside of the third region. (top right if vertical 4 is top right in horizontal)
Reg:click("img", 1, 3) This will create a new region starting from the top left corner (1) amd ending at the top right corner (3)
Reg:clickSub("img", 1, 2) This will click the image in the second sub region inside of the first region.
Reg:clickSub("img", 1, 1, 1, 4) This will create a region starting from the first sub region and ending at the 4th sub region of the first region. (first region is top left corner)
Now that you have an idea of how it works here is the issue i think there might be..
Because it uses the device's demintions that the script is running on, wont the location of buttons be different on other phones? Or do you not think this will be an issue? I dont have another device to test this on sadly.
|
|
|
Post by Zakun on Dec 15, 2016 23:39:58 GMT
If you make it work with the script's resolution, it should scale to the devices resolution, making it work on virtually every device.
|
|
|
Post by xxdxmhippiexx on Dec 16, 2016 14:43:46 GMT
If you make it work with the script's resolution, it should scale to the devices resolution, making it work on virtually every device. Ohh because ankulua automatically resizes based on the device and script demintions..that makes my life a lot simpler..is there a way to get the value of Settings:setScriptDimension()? if not i could just make a function in my script like Reg:scriptDimension()
|
|
|
Post by AnkuLua on Dec 16, 2016 15:51:26 GMT
No. You suppose not to change the scriptDimension.
|
|
|
Post by Zakun on Dec 16, 2016 18:45:13 GMT
The script dimension is the resolution that the images were made from For example, if you're making a script on a Samsung Galaxy S6 with 1440(Width) pixels by 2560(Height) resolution, which when the phone is on it's side becomes 2560 H by 1440 W. You'd set the script dimension as 2560. This lets AnkuLua know that the images were originally made on a device with 2560 height, and resizes the images to match the resolution of the device the script is running on. This means that whatever regions are set will scale to any device.
Not sure if I explained well enough how it works, but if you still don't get it or have more issues with this, I'll do what I can to help.
|
|
|
Post by xxdxmhippiexx on Dec 16, 2016 18:59:29 GMT
No. You suppose not to change the scriptDimension. I know, i was saying to let RegionHelper know what demintions the script was written on. Right now i am using getAppUsableScreenSize() and now see the error in doing that.
|
|
|
Post by xxdxmhippiexx on Dec 16, 2016 19:01:39 GMT
The script dimension is the resolution that the images were made from For example, if you're making a script on a Samsung Galaxy S6 with 1440(Width) pixels by 2560(Height) resolution, which when the phone is on it's side becomes 2560 H by 1440 W. You'd set the script dimension as 2560. This lets AnkuLua know that the images were originally made on a device with 2560 height, and resizes the images to match the resolution of the device the script is running on. This means that whatever regions are set will scale to any device. Not sure if I explained well enough how it works, but if you still don't get it or have more issues with this, I'll do what I can to help. Yes i get it, i didn't know regions were resized as well before..thought it was just images but that makes a lot more sense.
|
|