Text effects

Submitted by eLenka on 4 August, 2010 - 14:51
Text effects SWF Flash

Creating curved text and other text effects. Text effects demonstration without ActionScript.

Source archive: texttocurve.zip (197 KB)

 

Sample works

Some sample source: 
 var Movie: TFlashMovie;
     AP: array [0..2] of TPoint;
     TxtCurveData: TTextCurveInfo;
     i: integer;
     TxtSprite: TFlashSprite;
     Fnt: TFlashFont;
     stt: string;
begin
  Movie := TFlashMovie.Create(0, 0, 300 * twips, 200 * twips, 10);
  Movie.Version := 6;
  Movie.SystemCoord := scPix;
 
  AP[0] := Point(20, 100);
  AP[1] := Point(120, 120);
  AP[2] := Point(280, 140);
 
  TxtCurveData.Points := @AP;
  TxtCurveData.PointCount := 3;
//  TxtCurveData.ShowLine := true;
  TxtCurveData.Anchor := tcCenterAnchor;
  TxtCurveData.Rotate := tcrNormal;
 
 
  Fnt := Movie.AddFont;
  Fnt.Name := 'Tahoma';
  Fnt.Size := 20*twips;
  Fnt.Bold := true;
 
  stt := 'Sample Text';
  TxtSprite := AddTextToCurve(Movie, stt, Fnt, cswfSkyBlue, TxtCurveData);
  for i := 1 to 10 do
    begin
      AP[1] := Point(AP[1].X + i*2, AP[1].Y - i*3);
      ChangeTextToCurve(Movie, TxtSprite, stt, Fnt, cswfSkyBlue, TxtCurveData);
    end;
 
  With TxtSprite.FrameActions do
   begin
     SetTarget('_root');
     Play;
   end;
  TxtSprite.ShowFrame;
 
  Movie.PlaceObject(TxtSprite, 1);
  Movie.FrameActions.Stop;
  Movie.ShowFrame;
  Movie.RemoveObject(1);
 
  TxtSprite := AddRandomMoveText(Movie, stt, Fnt, cswfSkyBlue, 50, 10);
  Movie.PlaceObject(TxtSprite, 2).SetTranslate(90, 80);
 
  With TxtSprite.FrameActions do
   begin
     SetTarget('_root');
     Play;
   end;
  TxtSprite.ShowFrame;
 
  Movie.FrameActions.Stop;
  Movie.ShowFrame;
  Movie.MakeStream;
  Movie.SaveToFile('demo.swf');
  Movie.Free;