API Dokumentation

:TriggerAnimation(triggerID, animationTable)

Arguments

triggerID:string - a unique identifier, that allows to stop animation if needed.
animationTable:table - table that contains animations information, see extra section.

Notes

  • Will trigger the animation given by animationTable. As long as animation is still active it can be canceled with the given triggerID.

:StopAnimation(triggerID, fadeOut)

Arguments

triggerID:string - a unique identifier.
fadeOut:boolean - wether the frame should be smoothly faded out or just disappear.

Notes

  • Will cancel the given animation refered to by triggerID.
  • If fadeOut is true, frame will (slowly) fade out. (Will have no effect when frame is allready fading)

:StopAllAnimations(fadeOut)

Arguments

fadeOut:boolean - wether the frame should be smoothly faded out or just disappear.

Notes

  • Will cancel all animations.
  • If fadeOut is true, frame will (slowly) fade out. (Will have no effect when frame is allready fading)

:IsAnimationRunning(triggerID)

Arguments

triggerID:string - a unique identifier.

Returns

isTrue:boolean - returns true if there is allread an animation with this identifier

Notes

  • Will return if animation with given identifier is allready running

:Embed(target)

Arguments

target:table - library or addon to embed LibAvion-2.0 in.

Notes

  • Embeds methods from LibAvion-2.0 into target table.


AnimationTable format

Below you can see an overview of how the table needs to be formated, that is passed to ":TriggerAnimation(triggerID, animationTable)".

{
	init 			= {
		alpha 		= Alpha value when its shown (number)
		color 			= {
			r			= Red color when its shown (number)
			g 			= Green color when its shown (number)
			b 			= Blue color when its shown (number)
		}
		position 		= {
			x 			= X-Position on screen when its shown (number)
			y 			= Y-Position on screen when its shown (number)
		}
		scale			= Scale when its shown  (number)
		rotation 		= Rotation of texture when its shown (number)
		duration		= The time it should take from triggering the animation until the actual 
					animation should start. (number)
NOTE: Can be used to create difficult multi-animations.

	},
	anim 			= {
		alpha 		= Alpha value that is beeing animated to (number)
		color 			= {
			r 			= Red color that is beeing animated to (number)
			g 			= Green color that is beeing animated to (number)
			b 			= Blue color that is beeing animated to (number)
		}, 
		position 		= {
			x 			= X-Position that is beeing animated to (number)
			y 			= Y-Position that is beeing animated to (number)
		}, 
		scale 			= Scale that is beeing animated to (number)
		rotation 		= Rotations of texture that is beeing animated to (number)
		duration		= The time the "animation" phase should take (number)
	},
	fade 			= {
		alpha 		= Alpha value that is beeing animated to when fading (number)
		color 			= {
			r 			= Red color that is beeing animated to when fading (number)
			g 			= Green color that is beeing animated to when fading (number)
			b 			= Blue color that is beeing animated to when fading (number)
		}, 
		position 		= {
			x 			= X-Position that is beeing animated to when fading (number)
			y 			= Y-Position that is beeing animated to when fading (number)
		}, 
		scale 			= Scale that is beeing animated to when fading (number)
		rotation 		= Rotations of texture that is beeing animated to when fading (number)
		duration		= The time it should take the frame to fade out after completion. (number)
	},
	misc 			= {
		size 			= {
			width 		= Width when its shown (number)
			height 		= Height when its shown (number)
		},
		isAnimated 		= {
			alpha 		= Should visibility be animated? (bool)
			color 			= Should color be animated? (bool)
			position 		= Should position be animated? (bool)
			scale 			= Should scale be animated? (bool)
			rotation 		= Should rotation be animated? (bool)
		},
		addRandom 		= {
			alpha 		= Add some randomness to alpha animation (number)
			color 			= Add some randomness to color animation (number)
			position 		= Add some randomness to position animation (number)
			scale 			= Add some randomness to scale animation (number)
			rotation 		= Add some randomness to rotation animation (number)
		}
		animationFunc	= {
			alpha 		= Smoothness/speed of alpha animation (function)
			color 			= Smoothness/speed of color animation (function)
			position 		= Smoothness/speed of position animation (function)
			scale 			= Smoothness/speed of scale animation (function)
			rotation 		= Smoothness/speed of rotation animation (function)
		},
NOTE: All of this functions HAVE to be pointers to function with head 
"function (param, rnd)", where <param> is a value between 0 (start)
and 1 (end), depending on the time the animation has been running.
<rnd> is the value that can be set in the options dialogue under "Randomness",
its meant to add some random effect.

		animationFunc_	= {		
			alpha 		= Used for saving which function to use in animationFunc.alpha (string) [OPTIONAL]
			color 			= Used for saving which function to use in animationFunc.color (string) [OPTIONAL]
			position 		= Used for saving which function to use in animationFunc.position (string) [OPTIONAL]
			scale 			= Used for saving which function to use in animationFunc.scale (string) [OPTIONAL]
			rotation 		= Used for saving which function to use in animationFunc.rotation (string) [OPTIONAL]
		} [OPTIONAL]
NOTE: This is an optional setting, read more about it in LibAvionOptions-2.0!

		fadeMode		= How to fade the frame
NOTE: 0 means, use fade settings; 1 means fade and continue animation, 
2 means inverting animation when fading out

		showWhileWait 	= Allready show the frame/animation while
					"waitTime" is yet running (bool)
		textureFile 		= Texture file (file link, no SharedMedia!) to 
					the texture that should be used (string)
		textureFile_	= Used for saving which texture to use in textureFile (string) [OPTIONAL]		
NOTE: This is an optional setting, read more about it in LibAvionOptions-2.0!

		soundFile 		= Sound file (file link, no SharedMedia!) to the sound that is 
					triggered as soon as the animation starts (string)
		soundFile_		= Used for saving (!) which sound to use in soundFile (string) [OPTIONAL]
NOTE: This is an optional setting, read more about it in LibAvionOptions-2.0!

		mirror 		= {
			x 			= Mirror texture on x-axis (bool)
			y 			= Mirror texture on y-axis (bool)
		}
		noEnd 		= The animation won't fade when its finished, but will rather need 
					to be stopped with LibAvion:StopAnimation(...) (bool)
	},
}

Comments

Posts Quoted:
Reply
Clear All Quotes