Module AnimatedEffects
Animated graphical effects
Functions
| Effect.runStaticEffect (effectID, startX, startY) | Launch statical (non-moving) effect animation with default capabilities |
| Effect.runStaticEffectCentered (effectID, startX, startY) | Launch statical (non-moving) effect animation with default capabilities with center coordinates |
| Effect.runEffect (effectDef, centered) | Launch effect animation with custom capabilities by filling of EffectDef structure |
Class EffectDef
| EffectDef.id | [Required] ID of effect entry in a config pack |
| EffectDef.startX | [Required] Initial scene X position of effect |
| EffectDef.startY | [Required] Initial scene Y position of effect |
| EffectDef.startDelay | Start delay in milliseconds. |
| EffectDef.loopsCount | Limit effect be shown while animation will loop specified times. |
| EffectDef.maxDelay | Timeout limit of effect be shown in milliseconds. |
| EffectDef.frameDelay | Animation frame delay in milliseconds |
| EffectDef.frameSpeed | Animation frame delay in milliseconds, Alias to frameDelay |
| EffectDef:setSequence (frames) | Set custom animation sequence of frames. |
| EffectDef.velocityX | Horizontal motion velocity |
| EffectDef.velocityY | Vertical motion velocity |
| EffectDef.zIndex | Rendering Z position (priority) |
| EffectDef.priority | Rendering Z position (priority), Alias to zIndex. |
| EffectDef.gravity | Gravity scale (A multiplier of global gravity force) |
| EffectDef.direction | Face direction (for effects with frame-style equal to 2) |
| EffectDef.minVelX | Minimal horizontal velocity limit |
| EffectDef.minVelY | Minimal vertical velocity limit |
| EffectDef.maxVelX | Maximal horizontal velocity limit |
| EffectDef.maxVelY | Maximal vertical velocity limit |
| EffectDef.decelerateX | Horizontal speed deceleration |
| EffectDef.decelerateX | Vertical speed deceleration |
Functions
- Effect.runStaticEffect (effectID, startX, startY)
-
Launch statical (non-moving) effect animation with default capabilities
Parameters:
- effectID ulong ID of effect registered in the config pack
- startX double Initial horizontal scene position of effect at left-top corner of sprite
- startY double Initial vertical scene position of effect at left-top corner of sprite
- Effect.runStaticEffectCentered (effectID, startX, startY)
-
Launch statical (non-moving) effect animation with default capabilities with center coordinates
Parameters:
- effectID ulong ID of effect registered in the config pack
- startX double Initial horizontal scene position of effect by center of sprite
- startY double Initial vertical scene position of effect by center of sprite
- Effect.runEffect (effectDef, centered)
-
Launch effect animation with custom capabilities by filling of EffectDef structure
Parameters:
- effectDef EffectDef Effect definition structure with custom capabilities
- centered bool Use coordinates at center of effect sprite
Class EffectDef
Animation effect definition
- EffectDef.id
-
[Required] ID of effect entry in a config pack
- id ulong
- EffectDef.startX
-
[Required] Initial scene X position of effect
- startX double
- EffectDef.startY
-
[Required] Initial scene Y position of effect
- startY double
- EffectDef.startDelay
-
Start delay in milliseconds. How long to wait to show and begin the animation
- startDelay uint Wait until animation will be shown. Zero value means instant start of animation.
- EffectDef.loopsCount
-
Limit effect be shown while animation will loop specified times.
- loopsCount int If value is greater than 1, animation will disappear after specified animation sequence loops. Equal or less than 0 disable this limitation.
- EffectDef.maxDelay
-
Timeout limit of effect be shown in milliseconds.
- maxDelay int If value is greater than 1, animation will disappear after specified animation sequence loops. Equal or less than 0 disable this limitation.
- EffectDef.frameDelay
-
Animation frame delay in milliseconds
- frameDelay int
- EffectDef.frameSpeed
-
Animation frame delay in milliseconds, Alias to frameDelay
- frameSpeed int
- EffectDef:setSequence (frames)
-
Set custom animation sequence of frames.
Parameters:
- frames table An array of integers are indeces of frames on frameset. First frame is zero. Frame indeces can be repeated and total sequence length is unlimited.
- EffectDef.velocityX
-
Horizontal motion velocity
- velocityX double in pixels per ~1/65 of second
- EffectDef.velocityY
-
Vertical motion velocity
- velocityY double in pixels per ~1/65 of second
- EffectDef.zIndex
-
Rendering Z position (priority)
- zIndex double
- EffectDef.priority
-
Rendering Z position (priority), Alias to zIndex.
- priority double
- EffectDef.gravity
-
Gravity scale (A multiplier of global gravity force)
- gravity double Scale factor on global gravity value: 0.0 - gravity don't affects. 1.0 - same as environment gravity. -1.0 - inverted gravity.
- EffectDef.direction
-
Face direction (for effects with frame-style equal to 2)
- direction int -1 - left, +1 - right
- EffectDef.minVelX
-
Minimal horizontal velocity limit
- minVelX double
- EffectDef.minVelY
-
Minimal vertical velocity limit
- minVelY double
- EffectDef.maxVelX
-
Maximal horizontal velocity limit
- maxVelX double
- EffectDef.maxVelY
-
Maximal vertical velocity limit
- maxVelY double
- EffectDef.decelerateX
-
Horizontal speed deceleration
- decelerateX double
- EffectDef.decelerateX
-
Vertical speed deceleration
- decelerateX double