Class Cutscene.Builder
java.lang.Object
net.ixdarklord.coolcatcanvas.api.cutscene.Cutscene.Builder
- Enclosing class:
Cutscene
-
Method Summary
Modifier and TypeMethodDescriptionanchor(CutsceneAnchor anchor) bars(ValueTrack bars) How far the bars are in over time, 0 to 1, in place of sliding in at the start and out at the end.blendIn(float ticks) Glides from the player's own view into the first keyframe over these ticks, instead of cutting to it.blendOut(float ticks) Glides back to the player's own view over the last of these ticks.build()cut()Cuts to the last keyframe instead of moving into it.duration(float ticks) How long it lasts, in ticks; the last keyframe's time unless set.How the move into the last keyframe is paced.editable(boolean editable) Whether players can open it in the in-game editor; they can unless set.fade(ValueTrack fade) How dark the screen is over time, 0 to 1, for fades in the middle; replacesfadeInandfadeOut.fadeColor(int rgb) The colour faded to, as0xRRGGBB; black unless set.fadeIn(float ticks) Starts on a covered screen that clears over these ticks.fadeOut(float ticks) Ends on a covered screen, covering it over the last of these ticks.focus(CameraFocus focus) fov(float degrees) The last keyframe's field of view, in degrees: narrow to zoom in.hideHud(boolean hide) Whether the HUD and the player's hand are hidden while it plays; they are unless set.interpolation(Interpolation interpolation) The shape of the move into the last keyframe.keyframe(float time, net.minecraft.world.phys.Vec3 position, float yaw, float pitch) A keyframe reached along a smooth curve at an even pace; shape it with the calls below.keyframe(CameraKeyframe keyframe) keyframes(List<CameraKeyframe> keyframes) Replaces every keyframe.Letterbox bars framing the cinema ratio (Cutscene.CINEMATIC_ASPECT), sliding in at the start and out at the end.letterbox(float aspect) Letterbox bars framing an aspect ratio (width over height): top and bottom on a taller screen, left and right on a wider one.lockInput(boolean lock) Whether the player is held still while it plays; they are unless set.lookAt(net.minecraft.world.phys.Vec3 point) Keeps the camera looking at a point, in the cutscene's own space, for the whole cutscene.marker(float time, net.minecraft.resources.Identifier id) roll(float degrees) The last keyframe's tilt around the line of sight, in degrees.skippable(boolean skippable) Whether the player can skip it by holding the skip key; they can unless set.subtitle(float start, float duration, net.minecraft.network.chat.Component text)
-
Method Details
-
keyframe
public Cutscene.Builder keyframe(float time, net.minecraft.world.phys.Vec3 position, float yaw, float pitch) A keyframe reached along a smooth curve at an even pace; shape it with the calls below. -
keyframe
-
keyframes
Replaces every keyframe. -
easing
How the move into the last keyframe is paced. -
interpolation
The shape of the move into the last keyframe. -
cut
Cuts to the last keyframe instead of moving into it. -
roll
The last keyframe's tilt around the line of sight, in degrees. -
fov
The last keyframe's field of view, in degrees: narrow to zoom in. -
duration
How long it lasts, in ticks; the last keyframe's time unless set. Longer holds the last keyframe. -
anchor
-
letterbox
Letterbox bars framing the cinema ratio (Cutscene.CINEMATIC_ASPECT), sliding in at the start and out at the end. -
letterbox
Letterbox bars framing an aspect ratio (width over height): top and bottom on a taller screen, left and right on a wider one. 0 for none. -
bars
How far the bars are in over time, 0 to 1, in place of sliding in at the start and out at the end. -
fadeIn
Starts on a covered screen that clears over these ticks. -
fadeOut
Ends on a covered screen, covering it over the last of these ticks. -
fade
How dark the screen is over time, 0 to 1, for fades in the middle; replacesfadeInandfadeOut. -
fadeColor
The colour faded to, as0xRRGGBB; black unless set. -
focus
-
lookAt
Keeps the camera looking at a point, in the cutscene's own space, for the whole cutscene. -
subtitle
public Cutscene.Builder subtitle(float start, float duration, net.minecraft.network.chat.Component text) -
marker
-
blendIn
Glides from the player's own view into the first keyframe over these ticks, instead of cutting to it. -
blendOut
Glides back to the player's own view over the last of these ticks. -
hideHud
Whether the HUD and the player's hand are hidden while it plays; they are unless set. -
lockInput
Whether the player is held still while it plays; they are unless set. -
skippable
Whether the player can skip it by holding the skip key; they can unless set. -
editable
Whether players can open it in the in-game editor; they can unless set. Turn it off for a cutscene that is part of a mod's story. Registered from code, such a cutscene can be neither replaced by a resource pack nor copied through the editor. -
build
- Throws:
IllegalArgumentException- with no keyframes, two at the same time, or one keyframe and no duration
-