Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
1.1.0:particles [2023/07/31 15:01] – created - external edit 127.0.0.11.1.0:particles [2023/09/28 15:05] (current) – [Remarks] admin
Line 121: Line 121:
   FParticles.Colored.StartColor := TAlphaColorF.Create( TAlphaColorRec.Blue );   FParticles.Colored.StartColor := TAlphaColorF.Create( TAlphaColorRec.Blue );
   FParticles.Colored.EndColor := TAlphaColorF.Create( TAlphaColorRec.Blueviolet );   FParticles.Colored.EndColor := TAlphaColorF.Create( TAlphaColorRec.Blueviolet );
-  FParticles.ParticleSize   := TParticlePreset.Create(20, 20, 1, false); +  FParticles.ParticleSize.Preset(20, 20, 1, false); 
-  FParticles.ParticleGrowth := TParticlePreset.Create(0, 0, 1, false);+  FParticles.ParticleGrowth.Preset(0, 0, 1, false);
   FParticles.Colored.Enabled := false;   FParticles.Colored.Enabled := false;
   FParticles.Wind.Enabled := false;   FParticles.Wind.Enabled := false;
Line 151: Line 151:
 In effect particle will only be scaled within a specific size range. In effect particle will only be scaled within a specific size range.
  
 +====Changes since v1.1====
 +Due to design time support we changed the **TParticlePreset** and **TParticleVectorPreset** structured to classes.
 +This might affect elder code in your project.
 ===== Example ===== ===== Example =====
  
Line 196: Line 199:
  
   // randomize particle size and growth   // randomize particle size and growth
-  LParticles.ParticleSize   := TParticlePreset.Create(16, 16, 1, false); +  LParticles.ParticleSize.Preset(16, 16, 1, false); 
-  LParticles.ParticleGrowth := TParticlePreset.Create(4, 8, 1, false);+  LParticles.ParticleGrowth.Preset(4, 8, 1, false);
  
   LWind := TGorillaWindParticleInfluencer.Create(LParticles);   LWind := TGorillaWindParticleInfluencer.Create(LParticles);
Line 280: Line 283:
 procedure TForm1.FormCreate(Sender: TObject); procedure TForm1.FormCreate(Sender: TObject);
 var LParticleMat : TParticleMaterialSource; var LParticleMat : TParticleMaterialSource;
-    LVPreset   : TParticleVectorPreset; 
     LColorInfl : TGorillaColoredParticleInfluencer;     LColorInfl : TGorillaColoredParticleInfluencer;
 begin begin
Line 308: Line 310:
   // randomize particle properties   // randomize particle properties
   // 1) random position of particles   // 1) random position of particles
-  LVPreset := TParticleVectorPreset.Create(0, 0, 1000, Point3D(1, 1, 1), [axX, axY, axZ])+  FParticles.ParticlePosition.Preset(0, 0, 1000, Point3D(1, 1, 1), [axX, axY, axZ]);
-  FParticles.ParticlePosition := LVPreset ;+
  
   // 2) random velocity of particles   // 2) random velocity of particles
-  LVPreset := TParticleVectorPreset.Create(5, 10, 1000, Point3D(1, 2, 1), [axX, axY, axZ]); +  FParticles.ParticleVelocity.Preset(5, 10, 1000, Point3D(1, 2, 1), [axX, axY, axZ]); 
-  LVPreset.RangeY.Negative := false+  FParticles.ParticleVelocity.RangeY.Negative := false;
-  FParticles.ParticleVelocity := LVPreset;+
  
   // 3) the rest of properties   // 3) the rest of properties
-  FParticles.ParticleSize     := TParticlePreset.Create(2, 3, 1, false); +  FParticles.ParticleSize.Preset(2, 3, 1, false); 
-  FParticles.ParticleAngle    := TParticlePreset.Create(0, 360, 1, false); +  FParticles.ParticleAngle.Preset(0, 360, 1, false); 
-  FParticles.ParticleWeight   := TParticlePreset.Create(1, 1, 1, false); +  FParticles.ParticleWeight.Preset(1, 1, 1, false); 
-  FParticles.ParticleGrowth   := TParticlePreset.Create(0, 0, 1, false); +  FParticles.ParticleGrowth.Preset(0, 0, 1, false); 
-  FParticles.ParticleLifeTime := TParticlePreset.Create(500, 5000, 1000, false);+  FParticles.ParticleLifeTime.Preset(500, 5000, 1000, false);
  
   // create a color influencer for a starting and end color   // create a color influencer for a starting and end color