Component_CharacterBehavior Class
A behavior-component which handles the character-specific behavior like talking and idle.
Item Index
Methods
Properties
Methods
changeExpression
-
expression
-
duration
-
[callback]
Changes the characters expression using blending. If the duration is set to 0 the expression change is executed immediately without animation.
Parameters:
-
expression
vn.CharacterExpression- The character expression database-record.
-
duration
Number- The animation-duration in frames. Pass 0 to skip animation.
-
[callback]
Function optionalAn optional callback-function called when the change is finished.
onDataBundleRestore.
-
Object
-
gs.ObjectCodecContext
Called if this object instance is restored from a data-bundle. It can be used re-assign event-handler, anonymous functions, etc.
Parameters:
-
Object
Objectdata - The data-bundle
-
gs.ObjectCodecContext
Objectcontext - The codec-context.
setup
()
Initializes the component. Adds event-handlers.
setupEventHandlers
()
Adds event-handlers
startTalking
()
Lets the character start talking.
stopTalking
()
Lets the character stop with talking.
update
()
Updates character logic & animation-handling.
updateIdle
()
protected
Updates character's idle-animation.
updateTalking
()
protected
Updates character's talking-animation.
Properties
idleTime
Number
private
imageDuration
Number
private
imageIndex
Number
private
imageIndex
Number
Temporary game settings used by this character.
initialized
Boolean
private
talking
Boolean
Indicates if the character is currently talking.