Examples of GFX


Examples of org.joshy.gfx.draw.GFX

                (int)b.getWidth()+blurRadius*2,
                (int)b.getHeight()+blurRadius*2);

        //render shadow to buffer
        bufx.clear();
        GFX g2 = bufx.getGFX();
        g2.setPaint(FlatColor.BLACK);
        g2.translate(10, 10);
        fillShape(g2);
        g2.translate(-10, -10);
        bufx.apply(new BlurEffect(blurRadius));
        g2.dispose();

        //invert alpha channel
        for(int i=0; i<bufx.buf.getWidth(); i++) {
            for(int j=0; j<bufx.buf.getHeight(); j++) {
                int rgb = bufx.buf.getRGB(i,j);
View Full Code Here

Examples of org.joshy.gfx.draw.GFX

        buf = g.createBuffer(
                (int)b.getWidth()+blurRadius*2,
                (int)b.getHeight()+blurRadius*2);

        //draw shape with shadow color
        GFX g2 = buf.getGFX();

        //fill shape with black
        g2.setPaint(FlatColor.BLACK);
        g2.translate(blurRadius,blurRadius);
        g2.translate(-b.getX(),-b.getY());
        initPaint(g2);
        fillShape(g2);
        drawShape(g2);
        g2.translate(b.getX(),b.getY());
        //blur
        buf.apply(new BlurEffect(blurRadius));
        g2.translate(-blurRadius,-blurRadius);
        //use blur as alpha mask to draw in the real color
        buf.apply(new WipeColorEffect(shadow.getColor()));

        oldShadow = shadow;
    }
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.