REM Project: paintpro
REM Created: 9/21/2007 8:06:33 PM
REM
REM ***** Main Source File *****
REM
x as integer
y as integer
lastx as integer
lasty as integer
wasclast as integer = 0
blaleft as integer = 10
blatop as integer = 420
whileft as integer = 10
whitop as integer = 450
redleft as integer = 40
redtop as integer = 420
bluleft as integer = 40
blutop as integer = 450
yelleft as integer = 70
yeltop as integer = 420
greleft as integer = 70
gretop as integer = 450
Color = RGB(255,255,255)
Black = RGB(0,0,0)
White = RGB(255,255,255)
Red = RGB(255,0,0)
Green = RGB(0,255,0)
Blue = RGB(0,0,255)
Yellow = RGB(255,255,0)
Do
Box 0,410,640,480,Red,Green,Blue,Yellow
Box blaleft,blatop,blaleft+20,blatop+20,Black,Black,Black,Black
Box whileft,whitop,whileft+20,whitop+20,White,White,White,White
Box redleft,redtop,redleft+20,redtop+20,Red,Red,Red,Red
Box bluleft,blutop,bluleft+20,blutop+20,Blue,Blue,Blue,Blue
Box yelleft,yeltop,yelleft+20,yeltop+20,Yellow,Yellow,Yellow,Yellow
Box greleft,gretop,greleft+20,gretop+20,Green,Green,Green,Green
If MouseClick() = 1
x = MouseX()
y = MouseY()
If wasclast = 0
If erase = 0
Dot x,y,Color
Endif
Endif
If wasclast = 1
If erase = 0
LineMake(x,y,tempx,tempy,Color)
Endif
Endif
If x > blaleft and x < blaleft + 20 and y > blatop and y < blatop + 20
Color = Black
Endif
If x > whileft and x < whileft + 20 and y > whitop and y < whitop + 20
Color = White
Endif
If x > redleft and x < redleft + 20 and y > redtop and y < redtop + 20
Color = Red
Endif
If x > bluleft and x < bluleft + 20 and y > blutop and y < blutop + 20
Color = Blue
Endif
If x > yelleft and x < yelleft + 20 and y > yeltop and y < yeltop + 20
Color = Yellow
Endif
If x > greleft and x < greleft + 20 and y > gretop and y < gretop + 20
Color = Green
Endif
tempx = x
tempy = y
wasclast = 1
EndIf
If MouseClick() = 0
wasclast = 0
Endif
Loop
Function LineMake(topx,topy,nextx,nexty,col)
local dist as float
local angle as float
local tx as integer
local dx as integer
local dy as integer
dist = sqrt( ((nextx-topx)^2) + ((nexty-topy)^2) )
if dist <> 0
angle = asin((nextx-topx)/dist)
endif
if dist = 0
angle = 0
endif
For tx = 1 to dist
dx = (sin(angle)*tx)+topx
If nexty < topy
dy = topy-( (cos(angle)*tx) )
Else
dy = (cos(angle)*tx)+topy
Endif
Dot dx,dy,col
Next tx
EndFunction
Your signature has been deleted by a moderator because this joke is getting old.