|
Post by xxdxmhippiexx on Oct 17, 2016 20:58:06 GMT
How can i get a sub Region? i saw some docs for it but the constants wouldn't work for me..something like
size = getAppUsableScreenSize() width = size:getX() higth = size:getY() screen = Region(0, 0, width, higth)
left = screen.WEAST right = screen.EAST
topL = screen.TL topR = screen.TR btmL = screen.BL btmR = screen.BR
midTop = screen.NORTH_MID mid = MID_VERTICAL midBtm = screen.SOUTH_MID
|
|
|
Post by AnkuLua on Oct 18, 2016 0:08:48 GMT
No. It's not supported in AnkuLua.
|
|
Kako
Contributors
Posts: 105
|
Post by Kako on Oct 19, 2016 12:01:22 GMT
How can i get a sub Region? i saw some docs for it but the constants wouldn't work for me..something like size = getAppUsableScreenSize() width = size:getX() higth = size:getY() screen = Region(0, 0, width, higth) left = screen.WEAST right = screen.EAST topL = screen.TL topR = screen.TR btmL = screen.BL btmR = screen.BR midTop = screen.NORTH_MID mid = MID_VERTICAL midBtm = screen.SOUTH_MID Why do you need this? (What are you trying to accomplish?)
|
|
|
Post by xxdxmhippiexx on Nov 13, 2016 13:50:37 GMT
No. It's not supported in AnkuLua. So i made a region helper script with a fairly simple api..example Search top of screen RegionHelper:find("img", 1, 3) Search bottom right corner RegionHelper:find("img", 12) Search whole screen RegionHelper:find("img", 1, 12) Search left side RegionHelper:find("img", 1, 10) Also works with horizontal games/screen I have split the screen into 12 different regions and am working bugs out of "sub regions" (each region has 4 sub regions) Would this be helpfull to post or are there plans to make regions simpler?
|
|
|
Post by AnkuLua on Nov 13, 2016 14:39:09 GMT
No. It's not supported in AnkuLua. So i made a region helper script with a fairly simple api..example Search top of screen RegionHelper:find("img", 1, 3) Search bottom right corner RegionHelper:find("img", 12) Search whole screen RegionHelper:find("img", 1, 12) Search left side RegionHelper:find("img", 1, 10) Also works with horizontal games/screen I have split the screen into 12 different regions and am working bugs out of "sub regions" (each region has 4 sub regions) Would this be helpfull to post or are there plans to make regions simpler? It's good to share your script for sub regions. There are many choices on how many sub regions to divide. Some sub regions may overlap because different image size and location.
|
|
|
Post by xxdxmhippiexx on Nov 13, 2016 19:10:24 GMT
Ok! As soon as i get the main bugs worked out i will share it. What do you mean by regions overlapping? Ive never noticed anything like that..
|
|
|
Post by xxdxmhippiexx on Nov 13, 2016 19:13:01 GMT
This is a small portion of my code to break the screen up into the 12 main regions for a vertical screen.
local createVerticalRegions = function(w, h) Settings:setScriptDimension(false, h) local reg = {} local x = nil local y = nil local last = false for i, c in ipairs(rIndex)do if(not last)then reg[c] = Region(0, 0, w/3, h/4) last = reg[c] else if(last:getX() > 0)then x = last:getW() * 2 else x = last:getW() end if(x + last:getX() > w)then y = last:getH() + last:getY() x = 0 else y = last:getY() end reg[c] = Region(x, y, w/3, h/4) last = reg[c] end end return reg end
|
|
|
Post by xxdxmhippiexx on Nov 28, 2016 1:24:23 GMT
No. It's not supported in AnkuLua. Can i request setY() and setX() for regions in the next update please? (: i have gotten the main bugs out of my RegionHelper script but then decided i needed to add support for custom modifiers like so.. Reg.hightCrop = 2 --crops the next region used by half. This works but can only "crop" from the bottom up by using setH() Reg.cropTop = true --crops the region from the top down and this is my issue bc i can't setY() ): same goes for width "cropping". I decided to add this incase people need even smaller regions.
|
|
|
Post by xxdxmhippiexx on Nov 28, 2016 1:27:25 GMT
I could simply create a new region but if you saw my code you would see why that's not practical. /:
|
|