Examples of canvas()


Examples of playn.core.CanvasImage.canvas()

    /**
     * Creates a solid square icon of the given size.
     */
    public static Icon solid (int color, float size) {
        CanvasImage image = PlayN.graphics().createImage(1, 1);
        image.canvas().setFillColor(color).fillRect(0, 0, 1, 1);
        return scaled(image(image), size);
    }
}
View Full Code Here

Examples of playn.core.CanvasImage.canvas()

    public abstract void render (Canvas canvas, float x, float y);

    /** Creates an image large enough to accommodate this styled text, and renders it therein. */
    public CanvasImage toImage () {
        CanvasImage image = graphics().createImage(width(), height());
        render(image.canvas(), 0, 0);
        return image;
    }

    /** Creates an image large enough to accommodate this styled text, renders it therein and
     * returns an image layer with its translation adjusted per the effect renderer. */
 
View Full Code Here

Examples of playn.core.CanvasImage.canvas()

     * Creates an image large enough to accommodate the supplied text layout, renders the text into
     * it, and returns the image.
     */
    public CanvasImage toImage (TextLayout layout) {
        CanvasImage image = createImage(layout);
        render(image.canvas(), layout, 0, 0);
        return image;
    }

    /**
     * Creates an image with the supplied text laid out and rendered into it per this config, and
View Full Code Here

Examples of playn.core.CanvasImage.canvas()

      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.CanvasImage.canvas()

  }

  public CanvasImage asCanvasImage() {
    int diameter = radius * 2;
    CanvasImage circleImage = graphics().createImage(diameter, diameter);
    Canvas canvas = circleImage.canvas();
    canvas.setFillColor(color);
    canvas.fillCircle((float) radius, (float) radius, (float) radius);
    canvas.setAlpha(alpha);
   
    float strokeWidth = 16.0f;
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.