Class FadeToColorTransition
java.lang.Object
net.thewinnt.cutscenes.transition.FadeToColorTransition
- All Implemented Interfaces:
Transition
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.thewinnt.cutscenes.transition.Transition
Transition.TransitionSerializer<T extends Transition> -
Constructor Summary
ConstructorsConstructorDescriptionFadeToColorTransition(DynamicColor color, int lengthA, int lengthB, Easing easeIn, Easing easeOut, boolean isStart) FadeToColorTransition(DynamicColor color, int length, Easing easeIn, Easing easeOut, boolean isStart) FadeToColorTransition(DynamicColor colorBottomLeft, DynamicColor colorTopLeft, DynamicColor colorTopRight, DynamicColor colorBottomRight, int lengthA, int lengthB, Easing easeIn, Easing easeOut, boolean isStart) -
Method Summary
Modifier and TypeMethodDescriptionstatic FadeToColorTransitionfromJSON(com.google.gson.JsonObject json) static FadeToColorTransitionfromNetwork(net.minecraft.network.FriendlyByteBuf buf) intintReturns the time that will be added to the total cutscene time as a result of this transition running.intReturns the time of this transition that will be taken from the cutscene's time.net.minecraft.world.phys.Vec3getPos(double progress, net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 startPos, net.minecraft.world.phys.Vec3 pathRot, net.minecraft.world.phys.Vec3 initCamPos, CutsceneType cutscene) Returns the camera position at the specified momentnet.minecraft.world.phys.Vec3getRot(double progress, net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 startPos, net.minecraft.world.phys.Vec3 startRot, net.minecraft.world.phys.Vec3 initCamRot, CutsceneType cutscene) Returns the camera rotation at the specified momentvoidonEnd(CutsceneType cutscene) Executed when the transition ends.voidonFrame(double progress, CutsceneType cutscene) Executed every frame that this transition is active.voidonStart(CutsceneType cutscene) Executed when the transition begins.voidtoNetwork(net.minecraft.network.FriendlyByteBuf buf) Saves this transition for network transfer, so that it can be fully recreated on the receiving end.
-
Constructor Details
-
FadeToColorTransition
public FadeToColorTransition(DynamicColor colorBottomLeft, DynamicColor colorTopLeft, DynamicColor colorTopRight, DynamicColor colorBottomRight, int lengthA, int lengthB, Easing easeIn, Easing easeOut, boolean isStart) -
FadeToColorTransition
public FadeToColorTransition(DynamicColor color, int lengthA, int lengthB, Easing easeIn, Easing easeOut, boolean isStart) -
FadeToColorTransition
public FadeToColorTransition(DynamicColor color, int length, Easing easeIn, Easing easeOut, boolean isStart)
-
-
Method Details
-
getLength
public int getLength()- Specified by:
getLengthin interfaceTransition- Returns:
- the total length of this transition.
-
getOffCutsceneTime
public int getOffCutsceneTime()Description copied from interface:TransitionReturns the time that will be added to the total cutscene time as a result of this transition running. Should not change during a cutscene.- Specified by:
getOffCutsceneTimein interfaceTransition- Returns:
- the time spent outside the cutscene's length
-
getOnCutsceneTime
public int getOnCutsceneTime()Description copied from interface:TransitionReturns the time of this transition that will be taken from the cutscene's time. This means that the cutscene itself will be running, so a path will be shown.- Specified by:
getOnCutsceneTimein interfaceTransition- Returns:
- the time spent inside the cutscene's length
-
getPos
public net.minecraft.world.phys.Vec3 getPos(double progress, net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 startPos, net.minecraft.world.phys.Vec3 pathRot, net.minecraft.world.phys.Vec3 initCamPos, CutsceneType cutscene) Description copied from interface:TransitionReturns the camera position at the specified moment- Specified by:
getPosin interfaceTransition- Parameters:
progress- the progress of the transition [0-1]level- the level the transition is executed instartPos- the cutscene start position (specified in the command, defaults to [0, 100, 0])pathRot- the rotation of the pathinitCamPos- the camera position right before the cutscene startedcutscene- the cutscene the transition is associated with
-
getRot
public net.minecraft.world.phys.Vec3 getRot(double progress, net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 startPos, net.minecraft.world.phys.Vec3 startRot, net.minecraft.world.phys.Vec3 initCamRot, CutsceneType cutscene) Description copied from interface:TransitionReturns the camera rotation at the specified moment- Specified by:
getRotin interfaceTransition- Parameters:
progress- the progress of the transition [0-1]level- the level the transition is executed instartPos- the cutscene start position (world coordinates)startRot- the start rotation (specified in the command defaults to [0, 0, 0])initCamRot- the camera rotation right before the cutscene startedcutscene- the cutscene the transition is associated with
-
onStart
Description copied from interface:TransitionExecuted when the transition begins. It is guaranteed to be executed exactly once during the cutscene if it isn't stopped before this transition begins.- Specified by:
onStartin interfaceTransition- Parameters:
cutscene- the cutscene this transition is associated with
-
onFrame
Description copied from interface:TransitionExecuted every frame that this transition is active. This may not ever happen if the transition is too short.- Specified by:
onFramein interfaceTransition- Parameters:
progress- the progress of this transitioncutscene- the cutscene this transition is associated with
-
onEnd
Description copied from interface:TransitionExecuted when the transition ends. It is guaranteed to be executed exactly once during the cutscene if it isn't stopped before this transition begins.- Specified by:
onEndin interfaceTransition- Parameters:
cutscene- the cutscene this transition is associated with
-
toNetwork
public void toNetwork(net.minecraft.network.FriendlyByteBuf buf) Description copied from interface:TransitionSaves this transition for network transfer, so that it can be fully recreated on the receiving end.- Specified by:
toNetworkin interfaceTransition- Parameters:
buf- the buffer to write to
-
getSerializer
- Specified by:
getSerializerin interfaceTransition- Returns:
- a serializer that creates transitions of this type
-
fromNetwork
-
fromJSON
-