Examples of width()


Examples of playn.core.CanvasImage.width()

    @Override public Root setSize (float width, float height) {
        super.setSize(width, height);
        // update the image to the new size, if it's changed
        CanvasImage old = _image.get();
        if (old == null || old.width() != width || old.height() != height) {
            _image.update(graphics().createImage(width, height));
        }
        return this;
    }
View Full Code Here

Examples of playn.core.CanvasImage.width()

        @Override protected LayoutData createLayoutData (float hintX, float hintY) {
            return new LayoutData() {
                @Override public Dimension computeSize (float hintX, float hintY) {
                    CanvasImage image = _image.get();
                    return image == null ? new Dimension(0, 0) :
                        new Dimension(image.width(), image.height());
                }
            };
        }

        @Override protected void wasAdded () {
View Full Code Here

Examples of playn.core.ImageLayer.width()

            }
            protected final Runnable _clear = new Runnable() {
                public void run () { _shaker = null; }};
            protected Animation.Handle _shaker;
        });
        layer.addAt(click, (width-click.width())/2, 275);

        // demo animation groups
        CanvasImage ball = graphics().createImage(40, 40);
        ball.canvas().setFillColor(0xFF99CCFF).fillCircle(20, 20, 20);
        ImageLayer[] balls = new ImageLayer[6];
View Full Code Here

Examples of playn.core.ImageLayer.width()

                String instanceDesc;
                if (instance instanceof Movie) {
                    instanceDesc = ((Movie) instance).symbol().name();
                } else if (instance instanceof Texture) {
                    ImageLayer tLayer = ((Texture) instance).layer();
                    instanceDesc = "Texture (" + tLayer.width() + " x " + tLayer.height() + ")";
                    if (tLayer.destroyed()) {
                        instanceDesc += " (DESTROYED)";
                    }
                } else if (instance != null) {
                    instanceDesc = instance.toString();
View Full Code Here

Examples of playn.core.TextLayout.width()

    public void add (String label, final boolean header) {
        final TextLayout layout = graphics().layoutText(label, _fmt);
        _rows.add(new Row() {
            public void update () {} // noop
            public float labelWidth () { return 0; }
            public float width () { return layout.width(); }
            public float height() { return layout.height(); }
            public void render (Canvas canvas, float x, float y, float valueX) {
                if (header) canvas.drawLine(0, y-1, canvas.width(), y-1);
                canvas.fillText(layout, x, y);
                float by = y + layout.height();
View Full Code Here

Examples of playn.core.TextLayout.width()

        final TextLayout llayout = graphics().layoutText(label, _fmt);
        _rows.add(new Row() {
            public void update () {
                _vlayout = graphics().layoutText(String.valueOf(value.get()), _fmt);
            }
            public float labelWidth () { return llayout.width(); }
            public float width () { return llayout.width() + GAP + _vlayout.width(); }
            public float height() { return Math.max(llayout.height(), _vlayout.height()); }
            public void render (Canvas canvas, float x, float y, float valueX) {
                canvas.fillText(llayout, x, y);
                canvas.fillText(_vlayout, valueX, y);
View Full Code Here

Examples of playn.core.TextLayout.width()

        _rows.add(new Row() {
            public void update () {
                _vlayout = graphics().layoutText(String.valueOf(value.get()), _fmt);
            }
            public float labelWidth () { return llayout.width(); }
            public float width () { return llayout.width() + GAP + _vlayout.width(); }
            public float height() { return Math.max(llayout.height(), _vlayout.height()); }
            public void render (Canvas canvas, float x, float y, float valueX) {
                canvas.fillText(llayout, x, y);
                canvas.fillText(_vlayout, valueX, y);
            }
View Full Code Here

Examples of pythagoras.f.IDimension.width()

        float x = hrange._cpos, y = vrange._cpos, wid = hrange._size, hei = vrange._size;
        float bx = _elementBuffer.width(), by = _elementBuffer.height();
        for (Element<?> child : (Container<?>)content) {
            IDimension size = child.size();
            if (child.isVisible()) child.layer.setVisible(
                child.x() - bx < x + wid && child.x() + size.width() + bx > x &&
                child.y() - by < y + hei && child.y() + size.height() + by > y);
        }
    }

    /** Dispatches a {@link Listener#viewChanged()} to listeners. */
 
View Full Code Here

Examples of pythagoras.f.IDimension.width()

            // only compute the preferred size for the fixed elements in this pass
            Constraint c = constraint(elem);
            if (!c.stretch) {
                IDimension psize = preferredSize(elem, hintX, hintY);
                float pwidth = psize.width(), pheight = psize.height();
                m.prefWidth += pwidth;
                m.prefHeight += pheight;
                m.maxWidth = Math.max(m.maxWidth, pwidth);
                m.maxHeight = Math.max(m.maxHeight, pheight);
                m.fixWidth += pwidth;
View Full Code Here

Examples of pythagoras.f.IDimension.width()

            // the first argument to computeSize is not used for stretched elements
            float availX = hintX - m.gaps(_gap), availY = hintY - m.gaps(_gap);
            float ehintX = vert ? availX : c.computeSize(0, m.totalWeight, availX - m.fixWidth);
            float ehintY = vert ? c.computeSize(0, m.totalWeight, availY - m.fixHeight) : availY;
            IDimension psize = preferredSize(elem, ehintX, ehintY);
            float pwidth = psize.width(), pheight = psize.height();
            m.unitWidth = Math.max(m.unitWidth, pwidth / c.weight);
            m.unitHeight = Math.max(m.unitHeight, pheight / c.weight);
            m.maxWidth = Math.max(m.maxWidth, pwidth);
            m.maxHeight = Math.max(m.maxHeight, pheight);
        }
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.