Class AttributeTrack.Builder<V>
java.lang.Object
dev.wyck.level.dimension.timeline.AttributeTrack.Builder<V>
- Type Parameters:
V- the type of the attribute
- Enclosing interface:
AttributeTrack<V>
Builder for
AttributeTrack.- Since:
- 3.2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionattribute(EnvironmentAttribute<?> attribute) Sets the attribute of the track.attribute(EnvironmentAttributeSupplier<?> attribute) Sets the attribute of the track.build()Builds the attribute track.Sets the easing function of the track.grayKeyframe(int ticks, float brightness, float factor) Adds anAttributeOperation.BLEND_TO_GRAYkeyframe to a color attribute.keyframe(int ticks, float value, float alpha) Adds anAttributeOperation.ALPHA_BLENDkeyframe to a float attribute.Adds a keyframe to a color attribute from a hex string (e.g.Adds a keyframe to the track.Sets the keyframes of the track.operation(AttributeOperation operation) Sets the operation of the track.
-
Constructor Details
-
Builder
public Builder() -
Builder
-
-
Method Details
-
attribute
Sets the attribute of the track.- Parameters:
attribute- the attribute of the track- Returns:
- this builder
- Since:
- 3.2.0
-
attribute
@AsOf("3.2.0") public AttributeTrack.Builder<V> attribute(EnvironmentAttributeSupplier<?> attribute) Sets the attribute of the track.- Parameters:
attribute- the attribute of the track- Returns:
- this builder
- Since:
- 3.2.0
-
operation
Sets the operation of the track.- Parameters:
operation- the operation of the track- Returns:
- this builder
- Since:
- 3.2.0
-
easing
Sets the easing function of the track.- Parameters:
easing- the easing function of the track- Returns:
- this builder
- Since:
- 3.2.0
-
keyframes
Sets the keyframes of the track.- Parameters:
keyframes- the keyframes of the track- Returns:
- this builder
- Since:
- 3.2.0
-
keyframe
Adds a keyframe to the track.- Parameters:
ticks- the tick at which the keyframe should be appliedvalue- the value of the attribute at the given tick- Returns:
- this builder
- Since:
- 3.2.0
-
keyframe
Adds a keyframe to a color attribute from a hex string (e.g."#FF10F0").- Parameters:
ticks- the tick at which the keyframe should be appliedhex- the hex string of the color at the given tick- Returns:
- this builder
- Since:
- 3.2.0
-
keyframe
Adds anAttributeOperation.ALPHA_BLENDkeyframe to a float attribute.- Parameters:
ticks- the tick at which the keyframe should be appliedvalue- the value of the attribute at the given tickalpha- the alpha value of the attribute at the given tick- Returns:
- this builder
- Since:
- 3.2.0
-
grayKeyframe
@AsOf("3.2.0") public AttributeTrack.Builder<V> grayKeyframe(int ticks, float brightness, float factor) Adds anAttributeOperation.BLEND_TO_GRAYkeyframe to a color attribute.- Parameters:
ticks- the tick at which the keyframe should be appliedbrightness- the brightness of the color at the given tickfactor- the factor of the color at the given tick- Returns:
- this builder
- Since:
- 3.2.0
-
build
Builds the attribute track.- Returns:
- the built attribute track
- Since:
- 3.2.0
-