Record Class ValueTrack
java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.api.cutscene.ValueTrack
A number that changes over a cutscene, as keys in time: how far the letterbox bars are in, how dark the fade is.
Before the first key it holds the first value, after the last the last.
ValueTrack.of(0, 0.0F, 15, 1.0F) // 0 at the start, 1 from tick 15 on
ValueTrack.constant(1.0F)
ValueTrack.EMPTY.then(0, 1.0F).then(20, 0.0F, Easing.SINE_OUT) // from 1 down to 0, easing out
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ValueTrack> static final ValueTrackNo keys: 0 throughout. -
Constructor Summary
ConstructorsConstructorDescriptionValueTrack(List<ValueTrack.Key> keys) Creates an instance of aValueTrackrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatat(float time) The value at a time, in ticks.static ValueTrackconstant(float value) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisEmpty()keys()Returns the value of thekeysrecord component.static ValueTrackof(float... timesAndValues) Keys from pairs of a time and a value, eased gently between.then(float time, float value) This track with one more key, eased gently.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
EMPTY
No keys: 0 throughout. -
CODEC
-
-
Constructor Details
-
ValueTrack
Creates an instance of aValueTrackrecord class.- Parameters:
keys- the value for thekeysrecord component
-
-
Method Details
-
constant
-
of
Keys from pairs of a time and a value, eased gently between. -
then
This track with one more key, eased gently. -
then
-
isEmpty
public boolean isEmpty() -
at
public float at(float time) The value at a time, in ticks. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
keys
Returns the value of thekeysrecord component.- Returns:
- the value of the
keysrecord component
-