Again here's an updated version. This time i was awake enough to know what i was writing...
sync
global x1 as integer
global y1 as integer
global drawing as boolean
get image 1,0,0,screen width(), screen height(),1
do
if mouseclick()=1 or drawing=1 then linetool()
sync
loop
Function linetool()
if drawing = 0 and mouseclick()=1
x1=mousex() : y1=mousey()
drawing = 1
endif
if mouseclick()=0
drawing=0
get image 1,0,0,screen width(), screen height(),1
x1=0 : y1=0
else
paste image 1,0,0
line x1,y1,mousex(),mousey()
endif
endfunction
Quote: ":/ you'd just call it every loop..."
If that went on me, well, yes. But thats not what i was arguing on the otherones code. My point was that the program only stood in the line sequence without exiting and doing something else in the meantime(is meantime it written like this?).
Quote: "
@Zergei - Can I ask why you put drawing as boolean at the beginning?"
Reason is that i wanted that variable to distinguish when on is on drawing mode and when not. As only 2 states will it represent, i decided to make it a boolean.
Quote: "The only problem I found is that the first line you draw starts by the top left, not 0,0, more like 0,30. I'll try and fix it."
That was due to the "if" statement i left from your codes left over. Trying to fix something on your own will lead you to great understanding of things. Keep up that spirit and the good work of course.
Quote: "TDK, just tested the code, it's a brilliant line dragging code,"
It sure is, thats why i tried to best mine.
@TDK - Have you came up whith another method than just the "get image" and "paste image". I've been thinking of memblocks, and other things, but thought i might just ask.
Further on my stuff at...