Files
JiboOs/docs/rendering/animation/KeysAnimation.js

232 lines
6.0 KiB
JavaScript
Raw Normal View History

2026-03-16 13:53:01 +02:00
/**
* An abstract Layer for the eye.
* @class Layer
* @memberof jibo.rendering.animation
* @private
*/
/**
* A layer that represents the Eye.
* @class EyeLayer
* @memberof jibo.rendering.animation
* @private
*/
/**
* A layer of the KeysAnimation class that represents a timeline animation.
* @class TimelineLayer
* @memberof jibo.rendering.animation
* @private
* @param {Number} index The depth index.
* @param {String} name Name of the timeline.
* @param {jibo.rendering.animation.Timeline} timeline
* @param {Number} startTime The starting time of this animation in seconds.
* @param {Boolean} attach `true` if Timeline should be attached to the eye's position.
* @param {String} offset The frame offset to start playing the animation at
*/
/**
* Update the position of the animation.
* @method jibo.rendering.animation.TimelineLayer#update
* @param {Number} time Global time of the animation in seconds.
*/
/**
* Destroy and don't use after this.
* @method jibo.rendering.animation.TimelineLayer#destroy
*/
/**
* Class used by Animation Utilities to provide playback
* of keys files.
* @class KeysAnimation
* @memberof jibo.rendering.animation
* @extends EventEmitter
* @param {String} id The name of the keys file.
*/
/**
* The default framerate.
* @name jibo.rendering.animation.KeysAnimation.FRAMERATE
* @type {String}
* @default 30
*/
/**
* Event name when animation starts.
* @name jibo.rendering.animation.KeysAnimation.STARTED
* @type {String}
*/
/**
* Event name when animation stops.
* @name jibo.rendering.animation.KeysAnimation.STOPPED
* @type {String}
*/
/**
* Event name when builder event is fired.
* @name jibo.rendering.animation.KeysAnimation.EVENT
* @type {String}
*/
/**
* Event name when animation is cancelled.
* @name jibo.rendering.animation.KeysAnimation.CANCELLED
* @type {String}
*/
/**
* Event name when audio is played.
* @name jibo.rendering.animation.KeysAnimation.PLAY_AUDIO
* @type {String}
*/
/**
* Event name when timeline is played.
* @name jibo.rendering.animation.KeysAnimation.PLAY_TIMELINE
* @type {String}
*/
/**
* Event name when timeline needs to be reordered.
* @name jibo.rendering.animation.KeysAnimation.REORDER
* @type {String}
*/
/**
* Event when the timeline is updated.
* @name jibo.rendering.animation.KeysAnimation.UPDATE
* @type {String}
* @param {Number} time The current time in seconds from the start of animation.
* @param {Object} dofValues Collection of DOF values for the current frame.
*/
/**
* Asset Pack name.
* @name jibo.rendering.animation.KeysAnimation#assetPack
* @type {String}
*/
/**
* Resource root for animation (defaults to root of skill).
* @name jibo.rendering.animation.KeysAnimation#root
* @type {String}
*/
/**
* Id of the keys file in the cache.
* @name jibo.rendering.animation.KeysAnimation#id
* @type {String}
*/
/**
* Name of the keys file.
* @name jibo.rendering.animation.KeysAnimation#name
* @type {String}
*/
/**
* The collection of layers for the animation.
* @name jibo.rendering.animation.KeysAnimation#layers
* @type {Array<Layer>}
*/
/**
* Token of an asset load for our keys data, so it doesn't get unloaded under us.
* @private
*/
/**
* Map of Timeline objects.
* @name jibo.rendering.animation.KeysAnimation#timelines
* @type {Object}
*/
/**
* Map of PIXI.Texture objects.
* @name jibo.rendering.animation.KeysAnimation#textures
* @type {Object}
*/
/**
* Map of Sound objects.
* @name jibo.rendering.animation.KeysAnimation#sounds
* @type {Object}
*/
/**
* The animation options.
* @name jibo.rendering.animation.KeysAnimation#options
* @type {AnimationOptions<DOFSet>}
* @private
*/
/**
* The animation instance.
* @name jibo.rendering.animation.KeysAnimation#instance
* @type {AnimationInstance}
* @private
*/
/**
* Update the timelines.
* @method jibo.rendering.animation.KeysAnimation#update
* @param {Number} time Current time of this animation
*/
/**
* Set the keys animation data.
* @name jibo.rendering.animation.KeysAnimation#data
* @type {Object}
* @private
*/
/**
* Sync a movieclip to the playback of the animation.
* @method jibo.rendering.animation.KeysAnimation#playSync
* @param {animate.MovieClip} instance The clip to play.
* @param {String|Function} [event] The name of the event label or callback function.
* @param {Function} [callback] Callback when play is complete.
*/
/**
* Destroy the keys animation completely, after the Expression Service has told us that it has finished playing.
* @method jibo.rendering.animation.KeysAnimation#destroyWhenComplete
*/
/**
* Destroy the keys animation completely.
* @method jibo.rendering.animation.KeysAnimation#destroy
*/
/**
* Handle animation custom events.
* @method jibo.rendering.animation.KeysAnimation#onEvent
* @private
*/
/**
* Handle playing audio within the animation.
* @method jibo.rendering.animation.KeysAnimation#onPlayAudio
* @private
* @param {Object} payload
* @param {string} payload.file
*/
/**
* Reorder the layers of the animation.
* @method jibo.rendering.animation.KeysAnimation#reorder
* @private
*/
/**
* Handle the playing of a timeline event.
* @method jibo.rendering.animation.KeysAnimation#onPlayTimeline
* @private
* @param {object} payload
* @param {string} payload.file
* @param {number} payload.layerNum
* @param {boolean} payload.attach
* @param {string} payload.offset
*/