Package com.ardor3d.extension.atlas

Source Code of com.ardor3d.extension.atlas.AtlasPacker

/**
* Copyright (c) 2008-2012 Ardor Labs, Inc.
*
* This file is part of Ardor3D.
*
* Ardor3D is free software: you can redistribute it and/or modify it
* under the terms of its license which may be found in the accompanying
* LICENSE file or at <http://www.ardor3d.com/LICENSE>.
*/

package com.ardor3d.extension.atlas;

import com.ardor3d.math.Rectangle2;

public class AtlasPacker {
    private final AtlasNode rootNode;

    public AtlasPacker(final int width, final int height) {
        rootNode = new AtlasNode(width, height);
    }

    public AtlasNode insert(final int width, final int height) {
        return rootNode.insert(new Rectangle2(0, 0, width, height));
    }

    public AtlasNode insert(final Rectangle2 image) {
        return rootNode.insert(image);
    }

    public AtlasNode getRootNode() {
        return rootNode;
    }
}
TOP

Related Classes of com.ardor3d.extension.atlas.AtlasPacker

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.