# Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

### DarkBASIC Discussion / origin line ..if mouseclick()=2 ...

Message
Posted: 14th Oct 2002 09:25
Questo esempio ha le coordinate iniziali della linea a 0,0 -
Per creare l'inizio della linea con mouseclick()=2 come posso fare ?

Inoltre :

Come posso contare la misura delle linee create ?(La lunghezza totale delle linee o numero di punti totali)?

set display mode 1024,768,16
cls
rem .......
sync
rem .....

do
oldx=x
oldy=y

if mouseclick()=1
x=mousex()
y=mousey()
c=mousez()
ink rgb(100+c,100+c,100+c),0
line oldx, oldy, x, y
hide mouse
else
show mouse
endif
loop
Posted: 14th Oct 2002 13:30
simplamente :

xdist=abs(oldx-x)
ydist=abs(oldy-y)
misura=sqrt((xdist^2)+(ydist^2))
Posted: 14th Oct 2002 16:25
Sorry but not Work ! Non funziona -

set display mode 1024,768,16
cls
rem .......
sync
rem .....
do
xdist=abs(oldx-x)
ydist=abs(oldy-y)
if mouseclick()=1
x=mousex()
y=mousey()
c=mousez()
ink rgb(100+c,100+c,100+c),0
line oldx, oldy, x, y
hide mouse
else
show mouse
endif
misura=sqrt((xdist^2)+(ydist^2))
set cursor 0,100
print "misura=";misura()
loop

Posted: 14th Oct 2002 17:14
<img src="http://members.xoom.virgilio.it/LVS/a.gif">
This is a graphical request -

Posted: 14th Oct 2002 17:15
http://members.xoom.virgilio.it/LVS/a.gif