Package playn.core

Examples of playn.core.ImmediateLayer


        return "Flipbook Demo";
    }

    @Override protected Group createIface () {
        final float width = width(), height = height();
        ImmediateLayer bg = graphics().createImmediateLayer(new ImmediateLayer.Renderer() {
            public void render (Surface surf) {
                surf.setFillColor(0xFFCCCCCC);
                surf.fillRect(0, 0, width, height);
            }
        });
        bg.setDepth(-1);
        layer.add(bg);

        // test our simple frames
        final GroupLayer box = graphics().createGroupLayer();
        layer.addAt(box, 0, 100);
View Full Code Here


        } else if (layer instanceof ImageLayer) {
            ImageLayer il = (ImageLayer)layer;
            canvas.setAlpha(nalpha);
            canvas.drawImage(il.image(), 0, 0);
        } else if (layer instanceof ImmediateLayer) {
            ImmediateLayer il = (ImmediateLayer)layer;
            il.renderer().render(new CanvasSurface(canvas.setAlpha(nalpha)));
        }

        canvas.restore();
    }
View Full Code Here

  }

  public void drawTransparentCanvasImages() {
      // DOES NOT WORK FOR TRANSPARENCY
    // create an immediate layer and add to root layer
    ImmediateLayer circleLayer = graphics().createImmediateLayer(
        new ImmediateLayer.Renderer() {
          public void render(Surface surf) {
            Circle redCircle = new Circle(-25, 0, 50, Color.rgb(
                255, 0, 0), 0.5f);
            Circle whiteCircle = new Circle(0, 0, 50, Color.rgb(
View Full Code Here

TOP

Related Classes of playn.core.ImmediateLayer

Copyright © 2018 www.massapicom. 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.