Class ParticleSpec

java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.vfx.ParticleSpec

public final class ParticleSpec extends Object
What a kind of effect particle looks like and how it lives, built once and spawned many times with WorldParticles. Immutable.

 static final ParticleSpec EMBER = ParticleSpec.builder(VfxMaterial.additive(VfxMaterial.GLOW))
         .lifetime(20, 35)
         .size(Curve.of(0.12F, 0.2F, 0.0F).easing(Easing.EXPO_OUT, Easing.SINE_IN))
         .opacity(Curve.FADE)
         .color(0xFFD27A, 0xFF4A1C)
         .gravity(-0.004F)      // drifts up
         .drag(0.94F)
         .build();
 
These are not vanilla particles: they aren't registered, don't exist on the server and ignore the Particles video setting. They are drawn after the whole world, so glows show through water and clouds.
  • Method Details

    • builder

      public static ParticleSpec.Builder builder(VfxMaterial material)
    • material

      public VfxMaterial material()
    • shape

      public ParticleSpec.Shape shape()
    • minLifetime

      public int minLifetime()
    • maxLifetime

      public int maxLifetime()
    • size

      public Curve size()
    • opacity

      public Curve opacity()
    • startColor

      public int startColor()
    • endColor

      public int endColor()
    • colorEasing

      public Easing colorEasing()
    • spin

      public Curve spin()
    • randomRoll

      public boolean randomRoll()
    • gravity

      public float gravity()
    • drag

      public float drag()
    • stretch

      public float stretch()