Hello everybody!
I'm still new here and in the world of Lazarus.
I started to develop a game, in which there is a larger bitmap on the Form1. You can move this bitmap with the arrow buttons.
But I have a big problem with this: I can't delete the graphical elements from the previous places, and so these pull a strip as you can see on the attached image.
How can I delete the graphical components from the previouis places? The
invalidate; command doesn't work with it.
Pieces from my code:
procedure TForm1.FormCreate(Sender: TObject);
begin
width:=Screen.width;
height:=Screen.height;
palyakep:=TBitmap.Create;
palyakep.SetSize(width*2,height*2);
palyakep.canvas.brush.color:=clblue;
palyakep.canvas.fillrect(0,0,width*2,height*2);
(...)
palyafrissito:=TTimer.Create(nil);
palyafrissito.interval:=10;
palyafrissito.ontimer:=@palyafrissites;
procedure TForm1.palyafrissites(Sender: TObject);
begin
//figures moving...
with palyakep.canvas do invalidate;
procedure TForm1.FormPaint(Sender: TObject);
var puffalkepe: byte;
i: integer;
begin
canvas.draw(palyakepx,palyakepy,palyakep);
for i:=0 to puffancsdb-1 do
begin
puffalkepe:=trunc(puffancs[i].iranya*8/360);
if puffalkepe>7 then puffalkepe:=0;
palyakep.canvas.draw(puffancs[i].xhely,puffancs[i].yhely,puffancskep[puffalkepe]);
end;
end;