Examples of Initializer


Examples of tripleplay.particle.Initializer

    /**
     * Returns an initializer that provides a random lifespan between {@code min} and {@code max}.
     */
    public static Initializer random (final Randoms rando, final float min, final float max) {
        return new Initializer() {
            @Override public void init (int index, float[] data, int start) {
                data[start+ParticleBuffer.LIFESPAN] = rando.getInRange(min, max);
            }
        };
    }
View Full Code Here

Examples of tripleplay.particle.Initializer

    /**
     * Returns an initializer that increments the previously assigned velocity by the specified
     * amounts.
     */
    public static Initializer increment (final float dx, final float dy) {
        return new Initializer() {
            @Override public void init (int index, float[] data, int start) {
                float scale = graphics().ctx().scale.factor;
                data[start + ParticleBuffer.VEL_X] += dx * scale;
                data[start + ParticleBuffer.VEL_Y] += dy * scale;
            }
View Full Code Here

Examples of tripleplay.particle.Initializer

    /**
     * Returns an initializer that initializes the particle's color to the supplied constant value.
     */
    public static Initializer constant (final float r, final float g, final float b, final float a) {
        return new Initializer() {
            @Override public void init (int index, float[] data, int start) {
                data[start+ParticleBuffer.ALPHA_RED= playn.core.Color.encode(a, r);
                data[start+ParticleBuffer.GREEN_BLUE] = playn.core.Color.encode(g, b);
            }
        };
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.