local function showButton() button.isVisible = true end local function buttonPress(event) if event.phase == "ended" then button.isVisible = false print("Pass button pressed") buttonTimer = timer.performWithDelay(10000, showButton) end end group = display.newGroup() button = widget.newButton( { width = 240, height = 120, defaultFile = "pass2.png", overFile = "pass2.png", label = "pass", onEvent = buttonPress }) button.isVisible = true group:insert(button)
Thank you for the code I wasn’t sure why included buttnTouch for the onEvent but I just changed it to buttonpress.
Thank you very much for this code I really appreciate it.
Do you have any advice on multi-touch
I thought I had it covered with (below)
system.activate( "multitouch" )
but when I installed the APK on a phone it did not respond for multitouches only single touches
function Graph:tap(event) local locationX=event.x local locationY=event.y local brush=display.newCircle(locationX,locationY,3) brush:setFillColor(0.1,0.5,1) --Recorder counter=counter+1 local RPS="X: "..locationX.." Y: "..locationY table.insert(MyTable,counter,RPS) table.insert(LTX,counter,locationX) table.insert(LTY,counter,locationY) local Xmax= 0 local Xmin= 300 local Ymax= 0 local Ymin= 300 --Print Table for i=1,#MyTable do --print ("RPS: "..MyTable[i]) --print ("LTX: "..LTX[i].." MaxX: "..table.maxn(LTX).." LTY: "..LTY[i].." MaxY: "..table.maxn(LTY)) --print ("LTX: "..LTX[i].." LTY: "..LTY[i]) print ("LTY: "..LTY[i]) print ("LTX: "..LTX[i]) -- Sorting if Xmax \< LTX[i] then -- print ("OLD X Max: "..Xmax) Xmax=nil Xmax =LTX[i] --print ("NEW X Max: "..Xmax) end if Xmin \> LTX[i] then --print ("OLD X Min: "..Xmin) Xmin=nil Xmin =LTX[i] --print ("NEW X Min: "..Xmin) end if Ymax \< LTY[i] then --print ("OLD Y Max: "..Xmax) Ymax=nil Ymax =LTY[i] --print ("NEW Y Max: "..Ymax) end if Ymin \> LTY[i] then --print ("OLD Y Min: "..Ymin) Ymin=nil Ymin =LTY[i] --print ("NEW Y Min: "..Ymin) end --report end