Package playn.core

Examples of playn.core.ImageLayer.addListener()


            repeat(circle).tweenX(circle).to(width-150).in(1000).easeInOut().then().
            tweenX(circle).to(50).in(1000).easeInOut();

        // demo the shake animation
        final ImageLayer click = StyledText.span("Click to Shake", STYLE).toLayer();
        click.addListener(new Pointer.Adapter() {
            @Override public void onPointerStart (Pointer.Event event) {
                if (_shaker != null) _shaker.complete();
                else _shaker = anim.shake(click).bounds(-3, 3, -3, 0).cycleTime(25, 25).in(1000).
                         then().action(_clear).handle();
            }
View Full Code Here


        CanvasImage sqimg = graphics().createImage(50, 50);
        sqimg.canvas().setFillColor(0xFF99CCFF).fillRect(0, 0, 50, 50);
        final ImageLayer square = graphics().createImageLayer(sqimg);
        square.setOrigin(25, 25);
        layer.addAt(square, 50, 300);
        square.addListener(new Pointer.Adapter() {
            @Override public void onPointerStart (Pointer.Event event) {
                square.setInteractive(false);
                _banim.tweenXY(square).to(50, 350);
                _banim.delay(250).then().tweenRotation(square).to(FloatMath.PI).in(500);
                _banim.addBarrier(1000);
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.