Methods
-
math_deg_to_rad(degrees)
-
Converts the given degrees to radians and returns the result.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description degreesNumber the number of degrees to convert to radians.
Code Equivalent:
game.math.degToRad(degrees) -
math_rad_to_deg(radians)
-
Converts the given radians to degrees and returns the result.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description radiansNumber the number of radians to convert to degrees
Code Equivalent:
game.math.radToDeg(radians) -
phaser_easing(ease, direction)
-
Returns the chosen easing method in the given direction.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description easeeasing method to return
directiondirection for the easing method to use
Code Equivalent:
Phaser.ease.direction -
phaser_easing_linear()
-
Returns the linear easing method.
Check out the third party documentation for a more in depth explanation.Code Equivalent:
Phaser.Easing.Linear.None -
phaser_game_add_tween_from(target, duration, ease, autostart, delay, repeat, yoyo, properties)
-
Creates and returns a tween with the given properties. It will set the target to the destination value and tween to it's current value.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description targetthe object to add the tween to
durationNumber duration of the tween
easethe easing function to use on the tween
autostartBoolean option to automatically start the tween instead of manually calling tween.start()
delayNumber delay before the tween will start, in milliseconds
repeatNumber how many times the tween should repeat. Set to -1 to run forever
yoyoBoolean option for the tween to reverse itself and play backwards
properties(optional) optional properties to add to the tween
Code Equivalent:
game.add.tween(target).from(objectProperties, duration, ease, autostart, delay, repeat, yoyo) -
phaser_game_add_tween_to(target, duration, ease, autostart, delay, repeat, yoyo, properties)
-
Creates and returns a tween with the given properties. It will start at the current value and tween to the destination value.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description targetthe object to add the tween to
durationNumber duration of the tween
easethe easing function to use on the tween
autostartBoolean option to automatically start the tween instead of manually calling tween.start()
delayNumber delay before the tween will start, in milliseconds
repeatNumber how many times the tween should repeat. Set to -1 to run forever
yoyoBoolean option for the tween to reverse itself and play backwards
properties(optional) optional properties to add to the tween
Code Equivalent:
game.add.tween(target).to(objectProperties, duration, ease, autostart, delay, repeat, yoyo) -
phaser_resume_tween(tween)
-
Resumes the chosen tween.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description tweentween to resume
Code Equivalent:
tween.resume(); -
phaser_start_tween(tween)
-
Start the chosen tween object.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description tweentween to start
Code Equivalent:
tween.start(); -
phaser_stop_tween(tween, complete)
-
Stop the chosen tween.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description tweentween to stop
completeBoolean if true, dispatches the onComplete signal
Code Equivalent:
tween.stop(complete); -
phaser_yoyo_tween(tween, enable, delay, index)
-
Make the chosen tween run through the starting values and then play back in reverse.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description tweentween to yoyo
enableBoolean enable/disable yoyoing on the tween
delayNumber the amount of time to wait until the yoyo will start
indexNumber choose the object index on the tween to apply this to
Code Equivalent:
tween.yoyo(enable, delay, index);