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.

Newcomers DBPro Corner / origine - line

Author
Message
tmtm
21
Years of Service
User Offline
Joined: 9th Sep 2002
Location:
Posted: 14th Oct 2002 09:02
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 somma delle linee create ?(La lunghezza totale delle linee)

-
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
Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 14th Oct 2002 11:08
Translation?

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM
tmtm
21
Years of Service
User Offline
Joined: 9th Sep 2002
Location:
Posted: 14th Oct 2002 15:59
In this example initial coordinates of the line are 0,0-
For create the beginning of the line with [mouseclick] ()= 2 where do I want like could I do?
Besides:
How could I count the do you/he/she/it add of the lines do you create? (you total length of the lines in points or [pixel])

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

Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 16th Oct 2002 15:13
Prova questo:


Rem Project: line
Rem Created: 10/16/2002 10:32:16 AM
Rem Scorpyo
Rem rightclick=linestart
Rem leftclick=drawline
Rem ***** Main Source File *****
set display mode 800,600,16
cls
autocam off
backdrop off
linelength#=0
full_length#=0
do
if mouseclick()=2 then oldx=mousex():oldy=mousey()
x=mousex()
y=mousey()
if mouseclick()=1
line oldx,oldy,x,y
gosub linelength
oldx=x:oldy=y
endif
set cursor 0,0
print linelength#
print full_length#
loop

linelength:
xspan=abs(x-oldx)
yspan=abs(y-oldy)
if xspan+yspan=0 then return
linelength#=sqrt(xspan^2+yspan^2)
full_length#=full_length#+linelength#
return

ciao

tmtm
21
Years of Service
User Offline
Joined: 9th Sep 2002
Location:
Posted: 19th Oct 2002 08:50
Grazie
Thanks

Login to post a reply

Server time is: 2024-04-23 15:03:24
Your offset time is: 2024-04-23 15:03:24