Package assetmanager

Examples of assetmanager.Asset


    }

    private void addFontIfMissing(URL font, String fontName) throws IOException {
        if(assetDatabase.getFontByName(fontName) == null) {
            u.p("installing default font: " + font);
            Asset asset = assetDatabase.copyAndAddFont(font);
            new FontBuilder(asset.getFile()).resolve();
        } else {
            //u.p("the font is already instaleld: " + fontName);
            Asset asset = assetDatabase.getFontByName(fontName);
            new FontBuilder(asset.getFile()).resolve();
        }
    }
View Full Code Here


    public void addPattern(PatternPaint pat) {
        patternModel.add(pat);
        try {
            File file = File.createTempFile("foo", "png");
            ImageIO.write(pat.getImage(),"png",file);
            Asset asset = db.copyAndAddPattern(file);
            asset.setName("generated pattern");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

                        new File(resources, "common.css"));
                Util.copyToFile(this.getClass().getResourceAsStream("resources/cowboy.css"),
                        new File(resources, "cowboy.css"));
                Util.copyToFile(this.getClass().getResourceAsStream("resources/cowboybg.png"),
                        new File(resources, "cowboybg.png"));
                Asset font = Main.getDatabase().getFontByName("ChunkFive");//.getInputStream();
                Util.copyToFile(font.getInputStream(), new File(resources, "ChunkFive.ttf"));
            } catch (IOException e) {
                e.printStackTrace();
            }

        }
View Full Code Here

TOP

Related Classes of assetmanager.Asset

Copyright © 2018 www.massapicom. 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.