… i said im not asking for code but help approaching this, im not lazy, and thanks for helping with words instead of code, its more helpful even though it takes longer. lol.
Im on a pc right now so im working on this and ill post what i have soon.
EDIT: i read my post and it sounded mean, i didnt mean it that way, sorry. lol
i need an onclick event, how do i use that?
program new;
var b:TBitmap;cx,cy,bc,fc,s:integer;cw:boolean;a,r:extended;
const
sx=300;
sy=300;
procedure ScriptTerminate;
begin
FreeBitmap(b);
end;
procedure dp(x,y,size,col:integer);
var ix,iy:integer;
begin
for ix:= floor(-1*size/2) to ceil(size/2) do
for iy:= floor(-1*size/2) to ceil(size/2) do
FastSetPixel(b,x+ix,y+iy,col);
DrawBitmapDebugImg(b);
end;
function offset(origin:TPoint; distance,angle:extended):TPoint;
begin
result.x := Round(origin.x + distance * Cos( (angle-90) * 0.0174532925));
result.y := Round(origin.y + distance * Sin( (angle+90) * 0.0174532925));
end;
begin
ClearDebugImg;
DisplayDebugImgWindow(sx,sy);
b := CreateBitmap(sx,sy);
r:= 100
cx:= round(sx/2);
cy:= round(sy/2);
bc:=clBlack;
fc:=clAqua;
s:=3;
while not iskeydown(VK_RCONTROL) do
begin
wait(10);
if cw then
begin
a:=a+1;
dp(offset(point(cx,cy),r,a-1).x,offset(point(cx,cy),r,a-1).y,s,bc);
dp(offset(point(cx,cy),r,a).x,offset(point(cx,cy),r,a).y,s,fc);
end else
begin
a:=a-1;
dp(offset(point(cx,cy),r,a+1).x,offset(point(cx,cy),r,a+1).y,s,bc);
dp(offset(point(cx,cy),r,a).x,offset(point(cx,cy),r,a).y,s,fc);
end;
end;
end.
i need to figure out how to use an onclick event now.
EDIT: nvm im using a form but i need to draw a bitmap to it. how do i draw a bitmap to a form?
EDIT: new fail code =\
program new;
var vv:TVariantArray;f:tform;b:TBitmap;cx,cy,bc,fc,s:integer;cw:boolean;a,r:extended;
const
sx=300;
sy=300;
procedure ScriptTerminate;
begin
FreeBitmap(b);
end;
procedure dp(x,y,size,col:integer);
var ix,iy:integer;
begin
for ix:= floor(-1*size/2) to ceil(size/2) do
for iy:= floor(-1*size/2) to ceil(size/2) do
begin
f.canvas.MoveTo(x+ix,y+iy);
f.canvas.LineTo(x+ix,y+iy);
end;
end;
function offset(origin:TPoint; distance,angle:extended):TPoint;
begin
result.x := Round(origin.x + distance * Cos( (angle+90) * 0.0174532925));
result.y := Round(origin.y + distance * Sin( (angle-90) * 0.0174532925));
end;
procedure initform;
begin
f.SHOWMODAL;
end;
begin
b := CreateBitmap(sx,sy);
r:= 100
cx:= round(sx/2);
cy:= round(sy/2);
bc:=clBlack;
fc:=clAqua;
s:=3;
f.CREATENEW(nil);
ThreadSafeCall('initform',vv);
while not iskeydown(VK_RCONTROL) do
begin
wait(10);
if cw then
begin
a:=a+1;
dp(offset(point(cx,cy),r,a-1).x,offset(point(cx,cy),r,a-1).y,s,bc);
dp(offset(point(cx,cy),r,a).x,offset(point(cx,cy),r,a).y,s,fc);
end else
begin
a:=a-1;
dp(offset(point(cx,cy),r,a+1).x,offset(point(cx,cy),r,a+1).y,s,bc);
dp(offset(point(cx,cy),r,a).x,offset(point(cx,cy),r,a).y,s,fc);
end;
end;
end.