public override void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch) { Color value = Color.White * Opacity * 0.9f; value.A /= 2; Texture2D value2 = TextureAssets.Extra[98].get_Value(); Color color = ColorTint * Opacity * 0.5f; color.A = 0; Vector2 origin = value2.Size() / 2f; Color color2 = value * 0.5f; float num = Utils.GetLerpValue(0f, 20f, _timeSinceSpawn, clamped: true) * Utils.GetLerpValue(45f, 30f, _timeSinceSpawn, clamped: true); Vector2 vector = new Vector2(0.3f, 2f) * num * Scale; Vector2 vector2 = new Vector2(0.3f, 1f) * num * Scale; color *= num; color2 *= num; Vector2 position = settings.AnchorPosition + LocalPosition; SpriteEffects effects = SpriteEffects.None; spritebatch.Draw(value2, position, null, color, (float)Math.PI / 2f + Rotation, origin, vector, effects, 0f); spritebatch.Draw(value2, position, null, color, 0f + Rotation, origin, vector2, effects, 0f); spritebatch.Draw(value2, position, null, color2, (float)Math.PI / 2f + Rotation, origin, vector * 0.6f, effects, 0f); spritebatch.Draw(value2, position, null, color2, 0f + Rotation, origin, vector2 * 0.6f, effects, 0f); }
public virtual void Update(ref ParticleRendererSettings settings) { this.Velocity += this.AccelerationPerFrame; this.LocalPosition += this.Velocity; this.RotationVelocity += this.RotationAcceleration; this.Rotation += this.RotationVelocity; this.ScaleVelocity += this.ScaleAcceleration; this.Scale += this.ScaleVelocity; }
public override void Update(ParticleRendererSettings settings) { base.Update(settings); _timeSinceSpawn += 1f; if (_timeSinceSpawn >= _timeTolive) { base.ShouldBeRemovedFromRenderer = true; } }
public virtual void Update(ref ParticleRendererSettings settings) { Velocity += AccelerationPerFrame; LocalPosition += Velocity; RotationVelocity += RotationAcceleration; Rotation += RotationVelocity; ScaleVelocity += ScaleAcceleration; Scale += ScaleVelocity; }
public override void Update(ref ParticleRendererSettings settings) { base.Update(ref settings); ++this._timeSinceSpawn; if ((double)this._timeSinceSpawn < (double)this._timeTolive) { return; } this.ShouldBeRemovedFromRenderer = true; }
public override void Update(ref ParticleRendererSettings settings) { base.Update(ref settings); _timeSinceSpawn += 1f; Opacity = Utils.GetLerpValue(0f, 0.05f, _timeSinceSpawn / 60f, clamped: true) * Utils.GetLerpValue(1f, 0.9f, _timeSinceSpawn / 60f, clamped: true); if (_timeSinceSpawn >= 60f) { base.ShouldBeRemovedFromRenderer = true; } }
public void Update(ParticleRendererSettings settings) { Velocity += AccelerationPerFrame; LocalPosition += Velocity; _scale += ScaleOffsetPerFrame; if (_scale <= StopWhenBelowXScale) { ShouldBeRemovedFromRenderer = true; } }
public override void Update(ref ParticleRendererSettings settings) { base.Update(ref settings); ++this._timeSinceSpawn; this.Opacity = Utils.GetLerpValue(0.0f, 0.05f, this._timeSinceSpawn / 60f, true) * Utils.GetLerpValue(1f, 0.9f, this._timeSinceSpawn / 60f, true); if ((double)this._timeSinceSpawn < 60.0) { return; } this.ShouldBeRemovedFromRenderer = true; }
public void Update(ref ParticleRendererSettings settings) { this.Velocity += this.AccelerationPerFrame; this.LocalPosition += this.Velocity; this._scale += this.ScaleOffsetPerFrame; if ((double)this._scale > (double)this.StopWhenBelowXScale) { return; } this.ShouldBeRemovedFromRenderer = true; }
public override void Update(ref ParticleRendererSettings settings) { base.Update(ref settings); _timeSinceSpawn += 1f; if (_timeSinceSpawn >= _timeTolive) { base.ShouldBeRemovedFromRenderer = true; } if (++_gameFramesCounted >= GameFramesPerAnimationFrame) { _gameFramesCounted = 0; RandomizeFrame(); } }
public override void Update(ref ParticleRendererSettings settings) { base.Update(ref settings); ++this._timeSinceSpawn; if ((double)this._timeSinceSpawn >= (double)this._timeTolive) { this.ShouldBeRemovedFromRenderer = true; } if (++this._gameFramesCounted < this.GameFramesPerAnimationFrame) { return; } this._gameFramesCounted = 0; this.RandomizeFrame(); }
public override void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch) { Color color = new Color(120, 120, 120, 60) * Utils.GetLerpValue(1f, FadeOutNormalizedTime, _timeSinceSpawn / _timeTolive, clamped: true); Vector2 value = settings.AnchorPosition + LocalPosition; ulong seed = Main.TileFrameSeed ^ (((ulong)LocalPosition.X << 32) | (uint)LocalPosition.Y); Player player = Main.player[_indexOfPlayerWhoSpawnedThis]; for (int i = 0; i < 4; i++) { DrawData drawData = new DrawData(position: value + new Vector2(Utils.RandomInt(ref seed, -2, 3), Utils.RandomInt(ref seed, -2, 3)) * Scale, texture: _texture.get_Value(), sourceRect: _frame, color: color, rotation: Rotation, origin: _origin, scale: Scale, effect: SpriteEffects.None, inactiveLayerDepth: 0); drawData.shader = _packedShaderIndex; DrawData cdd = drawData; PlayerDrawHelper.SetShaderForData(player, 0, ref cdd); cdd.Draw(spritebatch); } Main.pixelShader.CurrentTechnique.Passes[0].Apply(); }
public override void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch) { Color color = new Color(120, 120, 120, 60) * Utils.GetLerpValue(1f, this.FadeOutNormalizedTime, this._timeSinceSpawn / this._timeTolive, true); Vector2 vector2_1 = settings.AnchorPosition + this.LocalPosition; ulong seed = Main.TileFrameSeed ^ ((ulong)this.LocalPosition.X << 32 | (ulong)(uint)this.LocalPosition.Y); Player player = Main.player[this._indexOfPlayerWhoSpawnedThis]; for (int index = 0; index < 4; ++index) { Vector2 vector2_2 = new Vector2((float)Utils.RandomInt(ref seed, -2, 3), (float)Utils.RandomInt(ref seed, -2, 3)); DrawData cdd = new DrawData(this._texture.Value, vector2_1 + vector2_2 * this.Scale, new Rectangle?(this._frame), color, this.Rotation, this._origin, this.Scale, SpriteEffects.None, 0) { shader = this._packedShaderIndex }; PlayerDrawHelper.SetShaderForData(player, 0, ref cdd); cdd.Draw(spritebatch); } Main.pixelShader.CurrentTechnique.Passes[0].Apply(); }
public override void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch) { Color color1 = Color.White * this.Opacity * 0.9f; color1.A /= (byte)2; Texture2D texture2D = TextureAssets.Extra[98].Value; Color color2 = this.ColorTint * this.Opacity * 0.5f; color2.A = (byte)0; Vector2 origin = texture2D.Size() / 2f; Color color3 = color1 * 0.5f; float num = Utils.GetLerpValue(0.0f, 20f, this._timeSinceSpawn, true) * Utils.GetLerpValue(45f, 30f, this._timeSinceSpawn, true); Vector2 scale1 = new Vector2(0.3f, 2f) * num * this.Scale; Vector2 scale2 = new Vector2(0.3f, 1f) * num * this.Scale; Color color4 = color2 * num; Color color5 = color3 * num; Vector2 position = settings.AnchorPosition + this.LocalPosition; SpriteEffects effects = SpriteEffects.None; spritebatch.Draw(texture2D, position, new Rectangle?(), color4, 1.570796f + this.Rotation, origin, scale1, effects, 0.0f); spritebatch.Draw(texture2D, position, new Rectangle?(), color4, 0.0f + this.Rotation, origin, scale2, effects, 0.0f); spritebatch.Draw(texture2D, position, new Rectangle?(), color5, 1.570796f + this.Rotation, origin, scale1 * 0.6f, effects, 0.0f); spritebatch.Draw(texture2D, position, new Rectangle?(), color5, 0.0f + this.Rotation, origin, scale2 * 0.6f, effects, 0.0f); }
public void Draw(ParticleRendererSettings settings, SpriteBatch spritebatch) { Color color = Color.Lerp(Color.White, new Color(255, 255, 255, 0), Utils.GetLerpValue(0.1f, 0.5f, _scale)); spritebatch.Draw(_texture.Value, settings.AnchorPosition + LocalPosition, _frame, color, 0f, _origin, _scale, SpriteEffects.None, 0f); }
public ParticleRenderer() { Settings = default(ParticleRendererSettings); }
public ParticleRenderer() { this.Settings = new ParticleRendererSettings(); }
public abstract void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch);
public override void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch) { Color color = ColorTint * Utils.GetLerpValue(0f, FadeInNormalizedTime, _timeSinceSpawn / _timeTolive, clamped: true) * Utils.GetLerpValue(1f, FadeOutNormalizedTime, _timeSinceSpawn / _timeTolive, clamped: true); spritebatch.Draw(_texture.get_Value(), settings.AnchorPosition + LocalPosition, _frame, color, Rotation, _origin, Scale, SpriteEffects.None, 0f); }
public void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch) { Color color = Color.Lerp(Color.White, new Color((int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue, 0), Utils.GetLerpValue(0.1f, 0.5f, this._scale, false)); spritebatch.Draw(this._texture.Value, settings.AnchorPosition + this.LocalPosition, new Rectangle?(this._frame), color, 0.0f, this._origin, this._scale, SpriteEffects.None, 0.0f); }
public override void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch) { Color color = this.ColorTint * Utils.GetLerpValue(0.0f, this.FadeInNormalizedTime, this._timeSinceSpawn / this._timeTolive, true) * Utils.GetLerpValue(1f, this.FadeOutNormalizedTime, this._timeSinceSpawn / this._timeTolive, true); spritebatch.Draw(this._texture.get_Value(), settings.AnchorPosition + this.LocalPosition, new Rectangle?(this._frame), color, this.Rotation, this._origin, this.Scale, SpriteEffects.None, 0.0f); }