Skip to content

Animation Guide

Oğuzhan edited this page Jul 21, 2025 · 5 revisions

JSAutoGUI let's you smoothly move your cursor with a smoothing function of your own.

The default tween is the linear tween which is defined as:

function linear(n) {
    return n
}

Here the variable n will go from 0 to 1 overtime, and the returned value is expected to be a smooth transition from 0 to 1.

Here's an example of a quadratic tween with moveRel:

gui.mouse.moveRel(100, 100, 5000, n => n * n)

This will move the mouse 100 pixels to right and down diagonally with the given quadratic smoothing function.

Here's a list of pre-defined tweens that you can use like gui.linear:

  • gui.linear
  • gui.easeInQuad
  • gui.easeOutQuad
  • gui.easeInOutQuad
  • gui.easeInCubic
  • gui.easeOutCubic
  • gui.easeInOutCubic
  • gui.easeInQuart
  • gui.easeOutQuart
  • gui.easeInOutQuart
  • gui.easeInQuint
  • gui.easeOutQuint
  • gui.easeInOutQuint
  • gui.easeInPoly
  • gui.easeOutPoly
  • gui.easeInOutPoly
  • gui.easeInSine
  • gui.easeOutSine
  • gui.easeInOutSine
  • gui.easeInExpo
  • gui.easeOutExpo
  • gui.easeInOutExpo
  • gui.easeInCirc
  • gui.easeOutCirc
  • gui.easeInOutCirc
  • gui.easeInElastic
  • gui.easeOutElastic
  • gui.easeInOutElastic
  • gui.easeInBack
  • gui.easeOutBack
  • gui.easeInOutBack
  • gui.easeInBounce
  • gui.easeOutBounce
  • gui.easeInOutBounce

Clone this wiki locally