uupaa.textureatlas.js

0.0.14 • Public • Published

TextureAtlas.js Build Status

npm

Create texture atlas

Document

Run on

Browser and node-webkit

<script src="lib/TextureAtlas.js"></script>
<script>
var imageList = ["http://.../a.png", ...];
var sprite = new TextureAtlas();

TextureAtlas.imageLoader(imageList, function(images) {
    var canvas = document.createElement("canvas");
    var ctx = canvas.getContext("2d");

    for (var i = 0, iz = images.length; i < iz; ++i) {
        sprite.draw(images[i].src, ctx, i * 32, i * 32);
    }
}, function(error) {
    throw error;
}, function(image) {
    sprite.add(image.src, image);
});
</script>

Package Sidebar

Install

npm i uupaa.textureatlas.js

Weekly Downloads

0

Version

0.0.14

License

MIT

Last publish

Collaborators

  • uupaa