forked from Jibo-Revival-Group/JiboOs
146 lines
3.6 KiB
JavaScript
146 lines
3.6 KiB
JavaScript
/**
|
|
* Abstract class for background, eye overlay and eye classes.
|
|
* @class AbstractLayer
|
|
* @extends PIXI.Container
|
|
* @memberof jibo.face
|
|
* @param {Boolean} cache `true` to cache textures.
|
|
*/
|
|
|
|
/**
|
|
* If should update according to DOFValues.
|
|
* @name jibo.face.AbstractLayer#connected
|
|
* @type {String}
|
|
*/
|
|
|
|
/**
|
|
* `true` if layer has been initialized.
|
|
* @name jibo.face.AbstractLayer#initialized
|
|
* @type {String}
|
|
* @protected
|
|
*/
|
|
|
|
/**
|
|
* Current cached timestamp.
|
|
* @name jibo.face.AbstractLayer#timestamp
|
|
* @type {Number[]}
|
|
* @protected
|
|
*/
|
|
|
|
/**
|
|
* Current cached dofValues.
|
|
* @name jibo.face.AbstractLayer#dofValues
|
|
* @type {Number[]}
|
|
* @protected
|
|
*/
|
|
|
|
/**
|
|
* Empty placeholder texture.
|
|
* @name jibo.face.AbstractLayer#_defaultTexture
|
|
* @type {PIXI.Texture}
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* Reference to the current texture.
|
|
* @name jibo.face.AbstractLayer#_texture
|
|
* @type {PIXI.Texture}
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* Current path of the texture loaded/loading.
|
|
* @name jibo.face.AbstractLayer#_texturePath
|
|
* @type {String}
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* The current asset loading
|
|
* @name jibo.face.AbstractLayer#_load
|
|
* @type {jibo.loader.AssetLoad}
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* The cache key of the texture currently in use.
|
|
* @name jibo.face.AbstractLayer#_textureCacheKey
|
|
* @type {jibo.loader.AssetToken}
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* Default eye texture when nothing is set.
|
|
* @method jibo.face.AbstractLayer#reset
|
|
* @param {Boolean} [resetPath=true] `false` to ignore resetting default path
|
|
*/
|
|
|
|
/**
|
|
* Default eye texture when nothing is set.
|
|
* @method jibo.face.AbstractLayer#init
|
|
* @param {PIXI.Texture} texture The default texture to use
|
|
*/
|
|
|
|
/**
|
|
* Display of DOFValues.
|
|
* @method jibo.face.AbstractLayer#display
|
|
* @param {Array<Number>} timestamp Timestamp when update is called.
|
|
* @param {jibo.face.DOFValues} dofValues Update display according to these values.
|
|
* @return {Boolean} `true` proceeds with update.
|
|
*/
|
|
|
|
/**
|
|
* Full path to the texture to use.
|
|
* @name jibo.face.AbstractLayer#texturePath
|
|
* @type {String}
|
|
*/
|
|
|
|
/**
|
|
* Destroy and don't use after this.
|
|
* @method jibo.face.AbstractLayer#destroy
|
|
*/
|
|
|
|
/**
|
|
* Set current eye texture.
|
|
* @method jibo.face.AbstractLayer#setTexture
|
|
* @param {PIXI.Texture} texture Texture to set.
|
|
* @override
|
|
*/
|
|
|
|
/**
|
|
* Value to tint.
|
|
* @method jibo.face.AbstractLayer#rgb2hex
|
|
* @protected
|
|
* @param {Number} red Red value from 0 to 1
|
|
* @param {Number} green Green value from 0 to 1
|
|
* @param {Number} blue Blue value from 0 to 1
|
|
* @return {int} The resulting uint color
|
|
*/
|
|
|
|
/**
|
|
* Check to see a path matches the default texture.
|
|
* @method jibo.face.AbstractLayer#_isDefaultTexture
|
|
* @param {PIXI.Texture} texture The default texture.
|
|
* @param {String} value Full path to test.
|
|
* @return {Boolean} `true` if the value is the default texture.
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* If there's a current load happen, stop it.
|
|
* @method jibo.face.AbstractLayer#_cancelLoad
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* Set the current texture path.
|
|
* @method jibo.face.AbstractLayer#_applyTexture
|
|
* @param {String} value Path to the texture
|
|
* @private
|
|
*/
|
|
|
|
/**
|
|
* Set the current texture path.
|
|
* @method jibo.face.AbstractLayer#_loadTexture
|
|
* @param {String} value Path to the texture
|
|
* @private
|
|
*/ |