# src/pixi/extras/Strip.js - Pixi.JS

#

API Docs for: 1.0.0
Show: Inherited Protected Private Deprecated

# File: src/pixi/extras/Strip.js

    /**
     * @author Mat Groves http://matgroves.com/
     */

    PIXI.Strip = function(texture, width, height)
    {
    	PIXI.DisplayObjectContainer.call( this );
    	this.texture = texture;
    	this.blendMode = PIXI.blendModes.NORMAL;

    	try
    	{
    		this.uvs = new Float32Array([0, 1,
    				1, 1,
    				1, 0, 0,1]);

    		this.verticies = new Float32Array([0, 0,
    						  0,0,
    						  0,0, 0,
    						  0, 0]);

    		this.colors = new Float32Array([1, 1, 1, 1]);

    		this.indices = new Uint16Array([0, 1, 2, 3]);
    	}
    	catch(error)
    	{
    		this.uvs = [0, 1,
    				1, 1,
    				1, 0, 0,1];

    		this.verticies = [0, 0,
    						  0,0,
    						  0,0, 0,
    						  0, 0];

    		this.colors = [1, 1, 1, 1];

    		this.indices = [0, 1, 2, 3];
    	}

    	/*
    	this.uvs = new Float32Array()
    	this.verticies = new Float32Array()
    	this.colors = new Float32Array()
    	this.indices = new Uint16Array()
    */
    	this.width = width;
    	this.height = height;

    	// load the texture!
    	if(texture.baseTexture.hasLoaded)
    	{
    		this.width   = this.texture.frame.width;
    		this.height  = this.texture.frame.height;
    		this.updateFrame = true;
    	}
    	else
    	{
    		this.onTextureUpdateBind = this.onTextureUpdate.bind(this);
    		this.texture.addEventListener( 'update', this.onTextureUpdateBind );
    	}

    	this.renderable = true;
    }

    // constructor
    PIXI.Strip.constructor = PIXI.Strip;
    PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );

    PIXI.Strip.prototype.setTexture = function(texture)
    {
    	//TODO SET THE TEXTURES
    	//TODO VISIBILITY

    	// stop current texture
    	this.texture = texture;
    	this.width   = texture.frame.width;
    	this.height  = texture.frame.height;
    	this.updateFrame = true;
    }

    PIXI.Strip.prototype.onTextureUpdate = function(event)
    {
    	this.updateFrame = true;
    }
    // some helper functions..