Eebado
Contributors
Posts: 165
|
Post by Eebado on Oct 4, 2019 16:33:03 GMT
I'm attempting to debug my script and was wondering if there is a way to easily see all taps/swipes that Ankulua is performing?
Looking for something similar to Region.highlight but for Location, or perhaps a simple method that I can call which will draw something on the screen quickly.
Thanks
|
|
|
Post by Mercobots on Oct 5, 2019 14:20:08 GMT
I'm attempting to debug my script and was wondering if there is a way to easily see all taps/swipes that Ankulua is performing? Looking for something similar to Region.highlight but for Location, or perhaps a simple method that I can call which will draw something on the screen quickly. Thanks Hi there , for that you will need to convert location to region! There are several ways to do it, i leave here a quick functional example! you can adapt it as your needs function myHighlight(obj, text, time) time = time or 1 local margin, _r = 5, nil
if (typeOf(obj) == 'userdata') then if (obj:typeOf() == "Location") then _r = Region(obj:getX() - margin, obj:getY() - margin, margin * 2, margin * 2) elseif (obj:typeOf() == "Region") then _r = obj end end
-- not a location and not a region fire a warning if not _r then _r = Region(0, 0, getRealScreenSize():getX(), 100) text = 'myHighlight wrong obj type -> ' .. typeOf(obj); time = 5 end _r:highlight(text, time) end
Show whit background and textmyHighlight(Location(10,100), "My Region or Location", 10) Show whit background without textmyHighlight(Location(10,100), "", 10) Show only bordersmyHighlight(Location(10,100), nil, 10)
|
|