User Guide
About creating a custom effect 231
The following table lists the methods and properties that you define in an instance class:
Instance method/property Description
constructor (Required) The class constructor. You typically call
the
super() method to invoke the superclass
constructor to initialize the inherited items from the
superclasses.
EffectInstance.play()
(Required) Invokes the effect. You must call
super.play() from your override.
EffectInstance.end()
(Optional) Interrupts an effect that is currently
playing, and jumps immediately to the end of the
effect.
EffectInstance.initEffect()
(Optional) Called if the effect was triggered by the
EffectManager. You rarely have to implement this
method. For more information, see “Overriding the
initEffect() method” on page 250.
TweenEffectInstance.onTweenUpdate()
(Required) Use when you create a subclass from
TweenEffectInstance. A callback method called at
regular intervals to implement a tween effect. For
more information, see “Example: Creating a tween
effect” on page 238.
TweenEffectInstance.onTweenEnd()
(Optional) Use when you create a subclass from
TweenEffectInstance. A callback method called
when the tween effect ends. You must call
super.onTweenEnd() from your override. For more
information, see “Example: Creating a tween effect”
on page 238.
Additional methods and properties (Optional) Define any additional methods and
properties. These typically correspond to the public
properties and methods from the factory class, and
any additional properties and methods that you
require to implement the effect.