本文整理汇总了C#中ParticleEffect.Init方法的典型用法代码示例。如果您正苦于以下问题:C# ParticleEffect.Init方法的具体用法?C# ParticleEffect.Init怎么用?C# ParticleEffect.Init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleEffect
的用法示例。
在下文中一共展示了ParticleEffect.Init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
void Init()
{
Effect = new ParticleEffect();
Effect.OnEnding += new ParticleEffect.ParticleEffectEventHandler(Effect_OnEnding);
Effect.Texture = Create.Texture("blurredbar");
Effect.Position = Position;
Effect.ParticleCount = 150;
Effect.GenerationPeriod = .1D;
Effect.GenerationCount = 20;
Effect.Gravity = 0F;
Effect.Mass = new Vector2f(10, 10);
Effect.MinPosition = new Vector2f(-15F, -4F);
Effect.MaxPosition = new Vector2f(15F, 4F);
Effect.MinColor = Color.Green;
Effect.MaxColor = Color.Green;
Effect.Acceleration = new Vector2f(0f, 5f);
Effect.AlphaLimit = new Vector2f(0.55f, .8f);
Effect.Angle = new Vector2f(270f, 270f);
Effect.DurationTime = new Vector2f(.5f, 1.2f);
Effect.Rotation = new Vector2f(0, 0);
Effect.MinScale = new Vector2f(.003f, .003f);
Effect.MaxScale = new Vector2f(.02f, .02f);
const float SV = .1F;
Effect.MinScaleVariation = new Vector2f(SV, SV);
Effect.MaxScaleVariation = new Vector2f(SV, SV);
Effect.Velocity = new Vector2f(10F, 70F);
Effect.Init();
}
示例2: InitParticle
private ParticleEffect InitParticle()
{
ParticleEffect pe = new ParticleEffect();
pe.Texture = Create.Texture("Particle_drop");
pe.Acceleration = new Vector2f(-60f, -60f);
pe.AlphaLimit = new Vector2f(0.5f, 0.5f);
pe.Angle = new Vector2f(0f, 360f);
pe.MinColor = Color.Black;
pe.MaxColor = Color.White;
pe.DurationTime = new Vector2f(1f, 1.5f);
pe.Position = new Vector2f(RandomHelper.Get(0F, Gui.Dimension.X), RandomHelper.Get(0F, Gui.Dimension.Y));
pe.Rotation = new Vector2f(0, 0);
pe.MinScale = new Vector2f(.03f, .03f);
pe.MaxScale = new Vector2f(.03f, .03f);
pe.Velocity = new Vector2f(10, 200);
pe.Init();
return pe;
}