Examples of ImageLayer


Examples of playn.core.ImageLayer

  @Override
  public void init() {
    // create and add background image layer
    Image bgImage = assets().getImage("images/bg.png");
    ImageLayer bgLayer = graphics().createImageLayer(bgImage);
    graphics().rootLayer().add(bgLayer);
  }
View Full Code Here

Examples of playn.core.ImageLayer

      logCount = 0;
     
      for (int n=0; n<logSize; n++) {
          logCount++;
          String message = logMessages.get(n);
          ImageLayer messageImage = generateLogMessageImageLayer(message);
          Number screenY = logScreenPos.y + (n * (logFontSize + 4));
          messageImage.transform().translate(logScreenPos.x, screenY.floatValue());
          logLayer.add(messageImage);
      }
     
      graphics().rootLayer().add(logLayer);
  }
View Full Code Here

Examples of playn.core.ImageLayer

   * Support Methods
   */
  private static ImageLayer generateLogMessageImageLayer(String message) {
      TextFormat logFormat_ = (logCount % 2 == 0) ? logFormat : logOddFormat;
     
      ImageLayer imageLayer = graphics().createImageLayer();
        TextLayout layout = graphics().layoutText(message, logFormat_);
        CanvasImage logImage = graphics().createImage(graphics().width(), logFontSize + 4);
        logImage.canvas().drawText(layout, 0, 0);
        imageLayer.setImage(logImage);
        return imageLayer;
    }
View Full Code Here

Examples of playn.core.ImageLayer

  }

  public ImageLayer asImageLayer() {
      // NOTE: use this for transparent images
    CanvasImage image = asCanvasImage();
    ImageLayer imageLayer = graphics().createImageLayer(image);
    imageLayer.setAlpha(alpha);
    imageLayer.transform().translate(getScreenX(), getScreenY());
    return imageLayer;
  }
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.