Class Easings
java.lang.Object
net.ixdarklord.coolcatcanvas.api.utils.Easings
The
Easing curves by name, for anything that is written down: cutscene files, commands, packets. The names
are the constants' in lower case ("sine_in_out").
Easing easing = Easings.byName("cubic_out"); // null when there is no such curve
String name = Easings.nameOf(Easing.CUBIC_OUT); // "cubic_out"
Easings.register("mymod:wobble", t -> ...); // a mod's own curve, usable wherever names are read
-
Field Details
-
CODEC
Reads and writes a curve as its name; a curve that was never named can't be written.
-
-
Method Details
-
register
Names a curve. Both sides of a connection need the same names for a curve to travel between them.- Throws:
IllegalArgumentException- if the name is taken by another curve
-
byName
-
nameOf
-
names
-