Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
1.1.0:particles [2023/07/31 15:01] – created - external edit 127.0.0.1 | 1.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 | + | FParticles.ParticleSize.Preset(20, 20, 1, false); |
- | FParticles.ParticleGrowth | + | 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 | + | LParticles.ParticleSize.Preset(16, 16, 1, false); |
- | LParticles.ParticleGrowth | + | LParticles.ParticleGrowth.Preset(4, 8, 1, false); |
LWind := TGorillaWindParticleInfluencer.Create(LParticles); | LWind := TGorillaWindParticleInfluencer.Create(LParticles); | ||
Line 280: | Line 283: | ||
procedure TForm1.FormCreate(Sender: | procedure TForm1.FormCreate(Sender: | ||
var LParticleMat : TParticleMaterialSource; | var LParticleMat : TParticleMaterialSource; | ||
- | LVPreset | ||
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 | ||
- | | + | |
- | FParticles.ParticlePosition := LVPreset | + | |
// 2) random velocity of particles | // 2) random velocity of particles | ||
- | | + | |
- | | + | |
- | FParticles.ParticleVelocity := LVPreset; | + | |
// 3) the rest of properties | // 3) the rest of properties | ||
- | FParticles.ParticleSize | + | FParticles.ParticleSize.Preset(2, 3, 1, false); |
- | FParticles.ParticleAngle | + | FParticles.ParticleAngle.Preset(0, 360, 1, false); |
- | FParticles.ParticleWeight | + | FParticles.ParticleWeight.Preset(1, 1, 1, false); |
- | FParticles.ParticleGrowth | + | FParticles.ParticleGrowth.Preset(0, 0, 1, false); |
- | FParticles.ParticleLifeTime | + | 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 |