Hi Guys
This will do for me, for now
Hope someone else find it usefull...
// Project: pressdetect
// Created: 2018-11-13
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "pressdetect" )
SetWindowSize( 1280, 720, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1280, 720 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
global dotid as integer[10000]
global count as integer
global dotsize as integer = 50
global dt as integer
AddVirtualButton(1,50,50,100)
AddVirtualButton(2,50,150,100)
AddVirtualButton(3,50,250,100)
a_id = loadimage('a.png')
createsprite(a_id,a_id)
SetSpritePosition(a_id,200,50)
dt = loadimage('dot.png')
createsprite(dt,dt)
SetSpritePosition(dt,10,600)
SetSpritesize(dt, dotsize,-1)
do
drawbox(180,40,800,690,200,200,200,200,0)
print(str(GetSpriteWidth(dt)))
if GetVirtualButtonPressed(1)
dotsize = dotsize + 5
if dotsize> 100
dotsize=100
endif
SetSpritesize(dt, dotsize,-1)
endif
if GetVirtualButtonPressed(2)
dotsize = dotsize - 5
if dotsize < 0
dotsize=5
endif
SetSpritesize(dt, dotsize,-1)
endif
if GetVirtualButtonPressed(3)
for i = 1 to 10000
DeleteSprite(dotid[i])
DeleteImage(dotid[i])
count = 0
next i
endif
if getpointerx() => 180 and getpointerx() <= 800 and getpointery() > 40 and getpointery() < 690
if GetPointerState()
drawdot(GetPointerX(),getpointerY())
endif
endif
sync()
print(count)
print(dotsize)
loop
function drawdot(x,y)
count = count + 1
dotid[count]=loadimage('dot.png')
createsprite(dotid[count],dotid[count])
SetSpritePosition(dotid[count],x-GetSpriteWidth(dt)/2,y-GetSpriteWidth(dt)/2)
SetSpriteSize(dotid[count],dotsize,-1)
endfunction