|
Post by zipper on Oct 1, 2019 18:52:01 GMT
I want the user to click screen when it turs yellow for capturing a image with pre defined x y size and also provide region at preset size that script will use after the startup. How do i do this?
I have a script that works fine but want to add a function from gui that let the user define a image with a simple click, figured i need location of the click and snap the image from location as center of image and add 50 pixels in widh and 30 pixels in height for the image to be saved. Center of image set region that could be X200 and Y200 from center of initial image snap.
Script is now using only location that user click from gui and clicks the location, want to make it more reliable using proper image instead.
The image is temporary and can preferably be overwritten every time script starts. Please help me out with this.
|
|
|
Post by zipper on Oct 2, 2019 8:27:42 GMT
Ok to get this going what i most urgently need is to know how to do the actual image by clicking, crop and save it to predefined size. Rest i can figure out most likely.
|
|
|
Post by AnkuLua on Oct 2, 2019 10:42:23 GMT
You can refer to snapAndPlay script ankulua.boards.net/thread/326/general-script-most-games-snapHere is the script for your reference local action, locTable, touchTable = getTouchEvent()
if (action == "click" or action == "longClick") then firstDown = locTable else firstDown = locTable[1] end local reg = Region(firstDown:getX()-25, firstDown:getX()-15, 50, 30) -- change 30, 50 to the suitable width and height reg:save("reg.png")
|
|
|
Post by zipper on Oct 4, 2019 9:53:00 GMT
local reg = Region(firstDown:getX()-25, firstDown:getX()-15, 50, 30)
Thank you, got it to work fine. Had to adjust second getX() to getY(), no biggie.
|
|