Class: Texture

me.WebGLRenderer. Texture

new Texture(atlas, texture, cached)

A Texture atlas object for WebGL
For portability, a global reference to this class is available through the default renderer: me.video.renderer.Texture

Currently supports :
- TexturePacker : through JSON export
- ShoeBox : through JSON export using the melonJS setting file
- Standard (fixed cell size) spritesheet : through a {framewidth:xx, frameheight:xx} object
Parameters:
Name Type Argument Default Description
atlas Object atlas information. See me.loader.getJSON
texture Image <optional>
atlas.meta.image texture name
cached Boolean <optional>
false Use true to skip caching this Texture
Source:
texture.js, line 8
Example
// create a texture atlas from a JSON Object
texture = new me.video.renderer.Texture(
    me.loader.getJSON("texture"),
    me.loader.getImage("texture")
);

// create a texture atlas for a spritesheet
texture = new me.video.renderer.Texture(
    { framewidth : 32, frameheight : 32 },
    me.loader.getImage("spritesheet")
);

Extends

Copyright © 2011 - 2017, Olivier Biot, Jason Oster, Aaron McLeod
Documentation generated by JSDoc 3.4.0 on 2017-02-28T11:37:42+08:00 using the DocStrap template modified by codename-.