IGSAPPlugin
Defined in: plugins/GSAPPlugin.ts:20
Interface for the GSAPPlugin, defining its public API for high-performance animations. Provides comprehensive GSAP integration with custom animation context management.
Extends
Section titled “Extends”Properties
Section titled “Properties”
readonly
anim: typeofgsap
Defined in: plugins/GSAPPlugin.ts:37
The GSAP instance for creating animations.
app:
IApplication
Defined in: plugins/Plugin.ts:10
Inherited from
Section titled “Inherited from”easeNames
Section titled “easeNames”
readonly
easeNames:string
[]
Defined in: plugins/GSAPPlugin.ts:25
Array of all registered custom ease names.
readonly
eases:Record
<string
,gsap.EaseFunction
>
Defined in: plugins/GSAPPlugin.ts:31
Object containing all registered custom eases, where keys are ease names and values are GSAP ease functions.
id:
string
Defined in: plugins/Plugin.ts:8
Inherited from
Section titled “Inherited from”options
Section titled “options”
readonly
options:Partial
<O
>
Defined in: plugins/Plugin.ts:12
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”addAnimation()
Section titled “addAnimation()”addAnimation(
animation
,contextId?
):Timeline
|Tween
| (Timeline
|Tween
)[]
Defined in: plugins/GSAPPlugin.ts:62
Adds one or more GSAP tweens or timelines to a specified animation context.
Animation contexts are custom collections (Set) of tweens/timelines managed by this plugin,
NOT gsap.Context
instances. If no contextId is provided, animations are added to the global context.
Parameters
Section titled “Parameters”animation
Section titled “animation”A single GSAP tween/timeline or an array of them
Timeline
| Tween
| (Timeline
| Tween
)[]
contextId?
Section titled “contextId?”string
Optional ID of the custom animation context. Defaults to the global context
Returns
Section titled “Returns”Timeline
| Tween
| (Timeline
| Tween
)[]
The animation(s) that were added
Example
Section titled “Example”// Add single animation to specific contextconst tween = gsap.to(mySprite, { x: 100, duration: 1 });gsapPlugin.addAnimation(tween, 'gameplayAnimations');
// Add multiple animations to global contextconst tweens = [ gsap.to(sprite1, { alpha: 0.5, duration: 1 }), gsap.to(sprite2, { rotation: Math.PI, duration: 2 })];gsapPlugin.addAnimation(tweens);
addSignalConnection()
Section titled “addSignalConnection()”addSignalConnection(…
args
):void
Defined in: plugins/Plugin.ts:20
Parameters
Section titled “Parameters”…SignalConnection
[]
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”clear()
Section titled “clear()”clear(
contextId
):void
Defined in: plugins/GSAPPlugin.ts:200
Clears (removes) a specific custom animation context and its tracked animations. If this results in no active contexts, the global collection is recreated if all contexts are cleared.
Parameters
Section titled “Parameters”contextId
Section titled “contextId”string
The ID of the animation context to clear
Returns
Section titled “Returns”void
Example
Section titled “Example”// Clean up completed level animationsgsapPlugin.clear('level1Animations');
clearAll()
Section titled “clearAll()”clearAll():
void
Defined in: plugins/GSAPPlugin.ts:211
Clears all custom animation contexts and recreates the plugin’s global animation collection.
Returns
Section titled “Returns”void
Example
Section titled “Example”// Complete reset when restarting the gamegsapPlugin.clearAll();
clearGlobal()
Section titled “clearGlobal()”clearGlobal():
void
Defined in: plugins/GSAPPlugin.ts:244
Clears all animations from the global animation collection managed by this plugin.
Returns
Section titled “Returns”void
Example
Section titled “Example”// Clear global animations for cleanupgsapPlugin.clearGlobal();
clearSignalConnections()
Section titled “clearSignalConnections()”clearSignalConnections():
void
Defined in: plugins/Plugin.ts:22
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”IPlugin
.clearSignalConnections
destroy()
Section titled “destroy()”destroy():
void
Defined in: plugins/Plugin.ts:18
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”getContext()
Section titled “getContext()”getContext(
contextId
):null
|Set
<Timeline
|Tween
>
Defined in: plugins/GSAPPlugin.ts:121
Retrieves a custom animation context (a Set of tweens/timelines) by its ID.
This is NOT a gsap.Context
instance but rather a custom collection for grouping animations.
Parameters
Section titled “Parameters”contextId
Section titled “contextId”string
The ID of the animation context
Returns
Section titled “Returns”null
| Set
<Timeline
| Tween
>
The animation context (a Set of tweens/timelines) or null if not found
Example
Section titled “Example”const menuAnimations = gsapPlugin.getContext('menuAnimations');if (menuAnimations) { console.log(`Menu has ${menuAnimations.size} active animations`);}
initialize()
Section titled “initialize()”initialize(
options
,app
):void
|Promise
<void
>
Defined in: plugins/Plugin.ts:14
Parameters
Section titled “Parameters”options
Section titled “options”Partial
<O
>
Returns
Section titled “Returns”void
| Promise
<void
>
Inherited from
Section titled “Inherited from”killAll()
Section titled “killAll()”killAll(
contextId?
):void
Defined in: plugins/GSAPPlugin.ts:170
Kills (stops and removes) all animations in a specified custom animation context, or all animations. If all contexts are killed, the plugin’s global animation collection is recreated.
Parameters
Section titled “Parameters”contextId?
Section titled “contextId?”string
Optional ID of the animation context. If omitted, kills all animations
Returns
Section titled “Returns”void
Example
Section titled “Example”// Kill specific context when transitioning scenesgsapPlugin.killAll('oldSceneAnimations');
// Emergency stop all animationsgsapPlugin.killAll();
killGlobal()
Section titled “killGlobal()”killGlobal():
void
Defined in: plugins/GSAPPlugin.ts:222
Kills all animations within the global animation collection managed by this plugin.
Returns
Section titled “Returns”void
Example
Section titled “Example”// Stop only global animations, keep context-specific onesgsapPlugin.killGlobal();
pauseAll()
Section titled “pauseAll()”pauseAll(
contextId?
):void
Defined in: plugins/GSAPPlugin.ts:153
Pauses all animations in a specified custom animation context, or all animations in all contexts.
Parameters
Section titled “Parameters”contextId?
Section titled “contextId?”string
Optional ID of the animation context. If omitted, pauses all animations
Returns
Section titled “Returns”void
Example
Section titled “Example”// Pause game animations when menu opensgsapPlugin.pauseAll('gameplayAnimations');
// Pause everything when app loses focusgsapPlugin.pauseAll();
playAll()
Section titled “playAll()”playAll(
contextId?
):void
Defined in: plugins/GSAPPlugin.ts:137
Plays all animations in a specified custom animation context, or all animations in all contexts.
Parameters
Section titled “Parameters”contextId?
Section titled “contextId?”string
Optional ID of the animation context. If omitted, plays all animations
Returns
Section titled “Returns”void
Example
Section titled “Example”// Play all animations in a specific contextgsapPlugin.playAll('gameplayAnimations');
// Play all animations in all contextsgsapPlugin.playAll();
postInitialize()
Section titled “postInitialize()”postInitialize(
_app
):void
|Promise
<void
>
Defined in: plugins/Plugin.ts:16
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
| Promise
<void
>
Inherited from
Section titled “Inherited from”registerCoreFunctions()
Section titled “registerCoreFunctions()”registerCoreFunctions():
void
Defined in: plugins/Plugin.ts:24
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”registerCoreSignals()
Section titled “registerCoreSignals()”registerCoreSignals():
void
Defined in: plugins/Plugin.ts:26
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”registerCustomEase()
Section titled “registerCustomEase()”registerCustomEase(
name
,ease
):Ease
Defined in: plugins/GSAPPlugin.ts:87
Registers a custom ease function with GSAP.
Parameters
Section titled “Parameters”string
The name of the custom ease
EaseFunction
The GSAP ease function
Returns
Section titled “Returns”An object containing the registered ease
Example
Section titled “Example”// Register a custom bounce easegsapPlugin.registerCustomEase('myBounce', (progress) => { return progress < 0.5 ? 2 * progress * progress : 1 - Math.pow(-2 * progress + 2, 3) / 2;});
// Use the custom ease in animationsgsap.to(mySprite, { x: 200, duration: 1, ease: 'myBounce' });
registerEases()
Section titled “registerEases()”registerEases(
eases
):Ease
Defined in: plugins/GSAPPlugin.ts:104
Registers multiple custom ease functions with GSAP in batch.
Parameters
Section titled “Parameters”Record
<string
, gsap.EaseFunction
>
An object where keys are ease names and values are GSAP ease functions
Returns
Section titled “Returns”The complete map of registered eases
Example
Section titled “Example”gsapPlugin.registerEases({ 'softBounce': (t) => t * t * (3 - 2 * t), 'sharpEase': (t) => t * t * t, 'customBack': (t) => t * t * (2.7 * t - 1.7)});
revertAll()
Section titled “revertAll()”revertAll(
contextId?
):void
Defined in: plugins/GSAPPlugin.ts:186
Reverts all animations in a specified custom animation context to their initial state.
Parameters
Section titled “Parameters”contextId?
Section titled “contextId?”string
Optional ID of the animation context. If omitted, reverts all animations
Returns
Section titled “Returns”void
Example
Section titled “Example”// Reset UI animations to initial stategsapPlugin.revertAll('uiAnimations');
// Reset everything for game restartgsapPlugin.revertAll();
revertGlobal()
Section titled “revertGlobal()”revertGlobal():
void
Defined in: plugins/GSAPPlugin.ts:233
Reverts all animations within the global animation collection to their initial state.
Returns
Section titled “Returns”void
Example
Section titled “Example”// Reset global animations without affecting contextsgsapPlugin.revertGlobal();