目前我有块(3d 立方体),当你点击一个时,它会在它上面创建另一个块。像这样
procedure TForm2.cubeClick(sender: TObject);
var
cube: Tcube;
begin
cube := Sender as Tcube;
if setblocks then
begin
totalblocks := totalblocks +1 ;
CreateCube[totalblocks]:=tcube.Create(self);
CreateCube[totalblocks].Visible := true;
CreateCube[totalblocks].Name := 'cubename'+inttostr(totalblocks);
CreateCube[totalblocks].Position.x := cube.Position.X;
CreateCube[totalblocks].Position.Y := cube.Position.y;
CreateCube[totalblocks].Position.Z := cube.Position.Z -1;
CreateCube[totalblocks].Material.Texture.CreateFromFile(gamedir+'\pics\'+blocktype);
CubeData[totalblocks] := blocktype;
CreateCube[totalblocks].Material.Lighting := false;
CreateCube[totalblocks].Material.Modulation := TTextureMode.tmReplace;
CreateCube[totalblocks].Parent := viewport3d1;
CreateCube[totalblocks].OnClick := cubeClick;
CreateCube[totalblocks].OnMouseDown := mousedown;
end;
label2.Text := inttostr(10000 - totalblocks);
end;
我遇到的问题是,如果我点击得足够快,它会停止添加块,不确定原因。但我想如果我可以禁用鼠标点击直到整个过程完成,那么它会处理它。这是你可以在firemonkey中做的事情,有人知道怎么做吗?
谢谢格伦