🧬Animation

Register

MTools.Animation.Register(name, reload);

NameTypeDescription

name

string

Group name.

reload

boolean

Does it need to be restarted. The advice is nil.

Allows you to register groups for animations. Example usage:

MTools.Animation:Register("MTools");
-- Registers the MTools group.

Update

MTools.Animation.Update(name, speed);

NameTypeDescription

name

string

Name of the registered group.

speed

number

Animation speed. Advised 7.5.

Allows you to update an animation group. Example usage:

MTools.Animation:Update("MTools", 5);
-- Updates the MTools group at 5 speed.

Lerp

MTools.Animation.Lerp(group, name, bool, from, to, speed);

NameTypeDescription

group

string

Group name.

name

string

Animation title. (Any)

bool

boolean

false - up. true - down.

from

(type)Below

From what (type). The recommendation is nil.

to

(type)Below

Until what (type). The recommendation is nil.

speed

number

Animation speed. Works only for animation of Colors, Tables, Vectors.

Allows you to animate Numbers, Colors, Vectors, Tables. Example usage:

Number
MTools.Animation:Register("MTools");
MTools.Animation:Update("MTools", 6);
local Number = MTools.Animation:Lerp("MTools", "Number", (globals.tickcount % 80 >= 40), 0, 1);
print(Number);
-- Creates an MTools group, gives the group 6 speed.
-- Animates a number from 0 to 1 at speed 6.
Color
MTools.Animation:Register("MTools");
MTools.Animation:Update("MTools", 6);
local Color = MTools.Animation:Lerp("MTools", "Color", (globals.tickcount % 80 >= 40), color(0, 0, 0, 255), color(255, 255, 255, 255));
print(Color);
-- Creates an MTools group, gives the group 6 speed.
-- Animates the color from black to white at speed 6.
Vector
MTools.Animation:Register("MTools");
MTools.Animation:Update("MTools", 6);
local Vector = MTools.Animation:Lerp("MTools", "Vector", (globals.tickcount % 80 >= 40), vector(0, 0, 0), vector(10, 10, 10));
print(Vector);
-- Creates an MTools group, gives the group 6 speed.
-- Animates the vector from (0, 0, 0) to (10, 10, 10) at speed 6.
-- A vector may NOT contain the variable Z(3).
Table
MTools.Animation:Register("MTools");
MTools.Animation:Update("MTools", 6);
local Table = MTools.Animation:Lerp("MTools", "Table", (globals.tickcount % 80 >= 40), { 0, 0, 0 }, { 10, 10, 10 });
print(Table);
-- Creates an MTools group, gives the group 6 speed.
-- Animates the table from (0, 0, 0) to (10, 10, 10) at speed 6.
-- Arrays can contain any number of objects.

Last updated