Combo

A plugin can easily expose a custom Combo as its Incident. When defining a Combo as plugin Incident the developer predefines the Combo's incidents. Any incidents that might get passed by the final users will completely be ignored and only the predefined will be applied.

Furthermore, plugin Combos can accept any attribute on their attrs object and these attributes can easily be used on the definition of the fix incidents of it.

To define the standard / fixed incidents of your Combo you only have to define the incidents getter of the API.Combo Class in order to return the incidents that your Combo will have.

Example

class MyPluginCombo extends MotorCortex.API.Combo {
get incidents(){
return [
{
incidentClass: Anime.Anime,
attrs: {
animatedAttrs: {
alpha: "@expression(index*2)"
}
},
props:{
duration: this.attrs.duration,
delay: "@expression(index*30)"
},
position: "@expression(index*100)"
},
{
incidentClass: Anime.Anime,
attrs: {
animatedAttrs: {
alpha: 3
}
},
props:{
selector: ".stagger",
duration: 1000,
delay: "@expression(index*100)"
},
position: "@expression(index*500 + 1000)"
}
]
}
}