效果:
思路:
- rectangle+circle+text组件。
- rectangle的fill的color设成black。
- circle置于rectangle和text组件中间层。
- 将circle的fill的color设成white。
- text的text的属性设成诗句,大小改成初一。
- 使用floatanimation组件加到circle上来控制其的position.x的属性变化,即将circle由左向右移动。
实现:
rectangle1的属性:
Rectangle1.Name := 'Rectangle1';
Rectangle1.Parent := Layout1;
Rectangle1.Align := FitLeft;
Rectangle1.Fill.Color := claBlack;
Rectangle1.Position.Y := 77.000000000000000000;
Rectangle1.Size.Width := 715.000000000000000000;
Rectangle1.Size.Height := 325.884277343750000000;
Rectangle1.Size.PlatformDefault := False;
circle1的属性:
Circle1.Name := 'Circle1';
Circle1.Parent := Rectangle1;
Circle1.Fill.Color := claWhite;
Circle1.Position.X := -60.000000000000000000;
Circle1.Position.Y := 120.000000000000000000;
Circle1.Size.Width := 97.000000000000000000;
Circle1.Size.Height := 81.000000000000000000;
Circle1.Size.PlatformDefault := False;
text1的属性:
Text1.Name := 'Text1';
Text1.Parent := Rectangle1;
Text1.Align := FitLeft;
Text1.Position.Y := 58.000000000000000000;
Text1.Size.Width := 715.000000000000000000;
Text1.Size.Height := 209.184661865234400000;
Text1.Size.PlatformDefault := False;
Text1.Text := #20154#29983#33509#21482#22914#21021#35265#65292#20309#20107#31179#39118#24754#30011#25159#12290;
floatanimation1的属性:
FloatAnimation1.Name := 'FloatAnimation1';
FloatAnimation1.Duration :=3;
FloatAnimation1.Loop := True;
FloatAnimation1.PropertyName := 'Position.X';
FloatAnimation1.StartValue := -60.000000000000000000;
FloatAnimation1.StopValue := 685.000000000000000000;
FloatAnimation1.Trigger := 'IsMouseOver=true';
代码:
procedure TForm1.Button1Click(Sender: TObject);
begin
self.FloatAnimation1.Enabled := True;
end;
代码下载:
链接:https://pan.baidu.com/s/1NvRUrTCwiWUz7-rbrqbFDQ
提取码:6zjt