Examples of canvas()


Examples of playn.core.CanvasImage.canvas()

                    add(Style.BACKGROUND.is(Background.blank().inset(2)));
                Group colorTable = new Group(new TableLayout(4));
                for (int ii = 0; ii < 256; ii++) {
                    CanvasImage colorImg = PlayN.graphics().createImage(16, 16);
                    colorImg.canvas().setFillColor(0xFF000000 | (ii << 16));
                    colorImg.canvas().fillRect(0, 0, 16, 16);
                    colorTable.add(new MenuItem("", Icons.image(colorImg)).addStyles(itemStyles));
                }
                menu.add(colorTable, slider);
                return menu;
            }
View Full Code Here

Examples of playn.core.CanvasImage.canvas()

     * image.
     * @see #capture(Layer, Canvas)
     */
    public static CanvasImage capture (Layer layer, float width, float height) {
        CanvasImage image = PlayN.graphics().createImage(width, height);
        capture(layer, image.canvas(), 1);
        return image;
    }

    /**
     * Creates a connection that will disconnect multiple other connections. NOTE: for best
View Full Code Here

Examples of playn.core.CanvasImage.canvas()

    @Override
    protected Instance instantiate (final IDimension size) {
        CanvasImage image = graphics().createImage(size.width(), size.height());
        if (_borderWidth > 0) {
            image.canvas().setFillColor(_borderColor);
            image.canvas().fillRoundRect(0, 0, size.width(), size.height(), _radius);
            // scale the inner radius based on the ratio of the inner height to the full height;
            // this improves the uniformity of the border substantially
            float iwidth = size.width() - 2*_borderWidth, iheight = size.height() - 2*_borderWidth;
            float iradius = _borderRadius * (iheight / size.height());
View Full Code Here

Examples of playn.core.CanvasImage.canvas()

    @Override
    protected Instance instantiate (final IDimension size) {
        CanvasImage image = graphics().createImage(size.width(), size.height());
        if (_borderWidth > 0) {
            image.canvas().setFillColor(_borderColor);
            image.canvas().fillRoundRect(0, 0, size.width(), size.height(), _radius);
            // scale the inner radius based on the ratio of the inner height to the full height;
            // this improves the uniformity of the border substantially
            float iwidth = size.width() - 2*_borderWidth, iheight = size.height() - 2*_borderWidth;
            float iradius = _borderRadius * (iheight / size.height());
            image.canvas().setFillColor(_bgColor);
View Full Code Here

Examples of playn.core.CanvasImage.canvas()

            image.canvas().fillRoundRect(0, 0, size.width(), size.height(), _radius);
            // scale the inner radius based on the ratio of the inner height to the full height;
            // this improves the uniformity of the border substantially
            float iwidth = size.width() - 2*_borderWidth, iheight = size.height() - 2*_borderWidth;
            float iradius = _borderRadius * (iheight / size.height());
            image.canvas().setFillColor(_bgColor);
            image.canvas().fillRoundRect(_borderWidth, _borderWidth, iwidth, iheight, iradius);
        } else {
            image.canvas().setFillColor(_bgColor);
            image.canvas().fillRoundRect(0, 0, size.width(), size.height(), _radius);
        }
View Full Code Here

Examples of playn.core.CanvasImage.canvas()

            // scale the inner radius based on the ratio of the inner height to the full height;
            // this improves the uniformity of the border substantially
            float iwidth = size.width() - 2*_borderWidth, iheight = size.height() - 2*_borderWidth;
            float iradius = _borderRadius * (iheight / size.height());
            image.canvas().setFillColor(_bgColor);
            image.canvas().fillRoundRect(_borderWidth, _borderWidth, iwidth, iheight, iradius);
        } else {
            image.canvas().setFillColor(_bgColor);
            image.canvas().fillRoundRect(0, 0, size.width(), size.height(), _radius);
        }
        ImageLayer layer = graphics().createImageLayer(image);
View Full Code Here

Examples of playn.core.CanvasImage.canvas()

            float iwidth = size.width() - 2*_borderWidth, iheight = size.height() - 2*_borderWidth;
            float iradius = _borderRadius * (iheight / size.height());
            image.canvas().setFillColor(_bgColor);
            image.canvas().fillRoundRect(_borderWidth, _borderWidth, iwidth, iheight, iradius);
        } else {
            image.canvas().setFillColor(_bgColor);
            image.canvas().fillRoundRect(0, 0, size.width(), size.height(), _radius);
        }
        ImageLayer layer = graphics().createImageLayer(image);
        if (alpha != null) layer.setAlpha(alpha);
        return new LayerInstance(size, layer);
View Full Code Here

Examples of playn.core.CanvasImage.canvas()

            float iradius = _borderRadius * (iheight / size.height());
            image.canvas().setFillColor(_bgColor);
            image.canvas().fillRoundRect(_borderWidth, _borderWidth, iwidth, iheight, iradius);
        } else {
            image.canvas().setFillColor(_bgColor);
            image.canvas().fillRoundRect(0, 0, size.width(), size.height(), _radius);
        }
        ImageLayer layer = graphics().createImageLayer(image);
        if (alpha != null) layer.setAlpha(alpha);
        return new LayerInstance(size, layer);
    }
View Full Code Here

Examples of playn.core.CanvasImage.canvas()

    }

    protected static Icon createDefaultThumbImage () {
        float size = 24;
        CanvasImage image = graphics().createImage(size, size);
        image.canvas().setFillColor(0xFF000000);
        image.canvas().fillCircle(size/2, size/2, size/2-1);
        return Icons.image(image);
    }

    protected class SliderLayoutData extends LayoutData {
View Full Code Here

Examples of playn.core.CanvasImage.canvas()

    protected static Icon createDefaultThumbImage () {
        float size = 24;
        CanvasImage image = graphics().createImage(size, size);
        image.canvas().setFillColor(0xFF000000);
        image.canvas().fillCircle(size/2, size/2, size/2-1);
        return Icons.image(image);
    }

    protected class SliderLayoutData extends LayoutData {
        public final float barWidth = resolveStyle(BAR_WIDTH);
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.