Animation <BadgeClient/>
Animation is a powerfull module to play animations in your script.
JO Variables > jo.animation.easeIn
Type : float:
A variable to set the ease in speed of animations
Default: 4.0
JO Variables > jo.animation.easeOut
Type : float
A variable to set the ease out speed of animations
Default: -4.0
JO Functions > jo.animation.faceEntity()
<!-- @include: ./slots/headers.md#client|jo.animation.faceEntity -->
Turn the ped to face the target <br>
<!-- @include: ./slots/descriptions.md#client|jo.animation.faceEntity -->
JO Functions > jo.animation.faceEntity() > Syntax
jo.animation.faceEntity(ped, target, waiter)
JO Functions > jo.animation.faceEntity() > Parameters
ped : integer
The ped to turn
target : integer
The target to face
waiter : boolean <BadgeOptional />
If need to reach the heading to end the function - default:true
<!-- @include: ./slots/examples.md#client|jo.animation.faceEntity -->
<!-- @include: ./slots/footers.md#client|jo.animation.faceEntity -->
JO Functions > jo.animation.goToCoords()
<!-- @include: ./slots/headers.md#client|jo.animation.goToCoords -->
Function to move a ped to a destination <br>
<!-- @include: ./slots/descriptions.md#client|jo.animation.goToCoords -->
JO Functions > jo.animation.goToCoords() > Syntax
jo.animation.goToCoords(ped, coords, speed, waiter, distanceToStop)
JO Functions > jo.animation.goToCoords() > Parameters
ped : integer
The ped to move
coords : vector
vec3 or vec4 - The coordinate of the destination <br> If vector4 is used, the ped will stop at the end and turn to the desired heading
speed : number <BadgeOptional />
The speed of the walk - default:1.0
waiter : boolean <BadgeOptional />
If need to wait the reach of location to end the function - default:false
distanceToStop : number <BadgeOptional />
The distance between the ped and the destination to stop it - default:0.0
<!-- @include: ./slots/examples.md#client|jo.animation.goToCoords -->
<!-- @include: ./slots/footers.md#client|jo.animation.goToCoords -->
JO Functions > jo.animation.load()
<!-- @include: ./slots/headers.md#client|jo.animation.load -->
Load the dictionnary of animation <br>
<!-- @include: ./slots/descriptions.md#client|jo.animation.load -->
JO Functions > jo.animation.load() > Syntax
jo.animation.load(dict, waiter)
JO Functions > jo.animation.load() > Parameters
dict : string
The dictionnary of the animation
waiter : boolean <BadgeOptional />
If need to wait the loading to end the function - default:false
<!-- @include: ./slots/examples.md#client|jo.animation.load -->
<!-- @include: ./slots/footers.md#client|jo.animation.load -->
JO Functions > jo.animation.play()
<!-- @include: ./slots/headers.md#client|jo.animation.play -->
Play animation. The function load automatically necessary resources. <br>
<!-- @include: ./slots/descriptions.md#client|jo.animation.play -->
JO Functions > jo.animation.play() > Syntax
jo.animation.play(ped, dict, name, duration, flag, offset)
JO Functions > jo.animation.play() > Parameters
ped : integer
The entity where the animation will be played
dict : string
The dictionnary of the animation
name : string
The name of the animation
duration : integer <BadgeOptional />
Duration of the animation in ms - default:-1
flag : integer <BadgeOptional />
The flag of the animation - default:0
offset : number <BadgeOptional />
The offset of the animation 0.0 <> 1.0 - default: 0.0
JO Functions > jo.animation.play() > Return Value
Type : number
<!-- @include: ./slots/examples.md#client|jo.animation.play -->
<!-- @include: ./slots/footers.md#client|jo.animation.play -->
JO Functions > jo.animation.setDesiredHeading()
<!-- @include: ./slots/headers.md#client|jo.animation.setDesiredHeading -->
Turn the ped to the desired heading <br>
<!-- @include: ./slots/descriptions.md#client|jo.animation.setDesiredHeading -->
JO Functions > jo.animation.setDesiredHeading() > Syntax
jo.animation.setDesiredHeading(ped, heading, waiter)
JO Functions > jo.animation.setDesiredHeading() > Parameters
ped : integer
The ped to turn
heading : number
The desired heading
waiter : boolean <BadgeOptional />
If need to reach the heading to end the function - default:true
<!-- @include: ./slots/examples.md#client|jo.animation.setDesiredHeading -->
<!-- @include: ./slots/footers.md#client|jo.animation.setDesiredHeading -->
JO Functions > jo.animation.waitTaskEnd()
<!-- @include: ./slots/headers.md#client|jo.animation.waitTaskEnd -->
<!-- @include: ./slots/descriptions.md#client|jo.animation.waitTaskEnd -->
JO Functions > jo.animation.waitTaskEnd() > Syntax
jo.animation.waitTaskEnd(ped, task)
<!-- @include: ./slots/examples.md#client|jo.animation.waitTaskEnd -->
<!-- @include: ./slots/footers.md#client|jo.animation.waitTaskEnd -->
JO Functions > jo.animation.play() > Parameters
ped : integer
The entity where the animation will be played
dict : string
The dictionnary of the animation
name : string
The name of the animation
duration : integer <BadgeOptional />
Duration of the animation in ms - default:-1
flag : integer|table <BadgeOptional />
Animation flags - default:0. Pass an integer value or a table of bit indices (e.g. {0,3}
offset : number <BadgeOptional />
The offset of the animation 0.0 <> 1.0 - default: 0.0