Examples of PixelTile


Examples of org.joshy.sketch.pixel.model.PixelTile

    private void drawLayer(GFX gfx, PixelLayer layer) {
        if(document.isRepeat()) {
            gfx.setPaint(FlatColor.RED);
            int size = document.getRepeatSize();
            PixelTile tile = layer.getTile(0, 0);
            if(tile != null) {
                try {
                    PatternPaint pat = PatternPaint.create(tile.getBuffer().getSubimage(0,0,size,size),null);
                    gfx.setPaint(pat);
                    gfx.fillRect(0, 0, 600, 600);
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
        for(PixelTile tile : layer.getTiles()) {
            if(tile.getImage() != null) {
                gfx.drawImage(tile.getImage(),tile.getX()*256,tile.getY()*256);
            }
            //tile grid lines
            //gfx.setPaint(FlatColor.RED);
            //gfx.drawRect(tile.getX()*256,tile.getY()*256,256,256);
        }
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.