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 ...

Author
Message
tmtm
17
Years of Service
User Offline
Joined: 9th Sep 2002
Location:
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
Freddix
AGK Developer
17
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 14th Oct 2002 13:30
simplamente :

xdist=abs(oldx-x)
ydist=abs(oldy-y)
misura=sqrt((xdist^2)+(ydist^2))
tmtm
17
Years of Service
User Offline
Joined: 9th Sep 2002
Location:
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

tmtm
17
Years of Service
User Offline
Joined: 9th Sep 2002
Location:
Posted: 14th Oct 2002 17:14
<img src="http://members.xoom.virgilio.it/LVS/a.gif">
This is a graphical request -

tmtm
17
Years of Service
User Offline
Joined: 9th Sep 2002
Location:
Posted: 14th Oct 2002 17:15
http://members.xoom.virgilio.it/LVS/a.gif

Login to post a reply

Server time is: 2020-08-13 18:37:44
Your offset time is: 2020-08-13 18:37:44