Package net.createmod.ponder.foundation
Class PonderSceneBuilder
java.lang.Object
net.createmod.ponder.foundation.PonderSceneBuilder
- All Implemented Interfaces:
SceneBuilder
Enqueue instructions to the schedule via this object's methods.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassclassclassclass -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInstruction(Consumer<PonderScene> callback) Adds a simple instruction to the scene.voidaddInstruction(PonderInstruction instruction) Adds an instruction to the scene.voidAdds a Key Frame at the end of the last delay() instruction for the users to skip tovoidAdds a Key Frame a couple ticks after the last delay() instruction for the users to skip tovoidconfigureBasePlate(int xOffset, int zOffset, int basePlateSize) Communicates to the ponder UI which parts of the schematic make up the base horizontally.debug()Additional tools for debugging ponder and bypassing the facadeeffects()Special effects to embellish and communicate withgetScene()voididle(int ticks) Before running the upcoming instructions, wait for a duration to let previous actions play out.voididleSeconds(int seconds) Before running the upcoming instructions, wait for a duration to let previous actions play out.voidOnce the scene reaches this instruction in the timeline, mark it as "finished".overlay()Ponder's toolkit for showing information on top of the scene world, such as highlighted bounding boxes, texts, icons and keybindings.voidUse this to disable the base plate's shadow for this scenevoidrotateCameraY(float degrees) Pans the scene's camera view around the vertical axis by the given amountvoidscaleSceneView(float factor) Use this in case you are not happy with the scale of the scene relative to the overlayvoidsetNextUpEnabled(boolean isEnabled) Control whether the "next scene" popup should be displayed for this scene once the previous scene has finished running all of its instructions.voidsetSceneOffsetY(float yOffset) Use this in case you are not happy with the vertical alignment of the scene relative to the overlayvoidFade the layer of blocks into the scene ponder assumes to be the base plate of the schematic's structure.special()Random other instructions that might come in handyvoidAssign a unique translation key, as well as the standard english translation for this scene's title using this method, anywhere inside the program function.world()Instructions for manipulating the schematic and its currently visible areas.
-
Field Details
-
scene
-
-
Constructor Details
-
PonderSceneBuilder
-
-
Method Details
-
overlay
Description copied from interface:SceneBuilderPonder's toolkit for showing information on top of the scene world, such as highlighted bounding boxes, texts, icons and keybindings.- Specified by:
overlayin interfaceSceneBuilder
-
world
Description copied from interface:SceneBuilderInstructions for manipulating the schematic and its currently visible areas. Allows to show, hide and modify blocks as the scene plays out.- Specified by:
worldin interfaceSceneBuilder
-
debug
Description copied from interface:SceneBuilderAdditional tools for debugging ponder and bypassing the facade- Specified by:
debugin interfaceSceneBuilder
-
effects
Description copied from interface:SceneBuilderSpecial effects to embellish and communicate with- Specified by:
effectsin interfaceSceneBuilder
-
special
Description copied from interface:SceneBuilderRandom other instructions that might come in handy- Specified by:
specialin interfaceSceneBuilder
-
getScene
- Specified by:
getScenein interfaceSceneBuilder
-
title
Description copied from interface:SceneBuilderAssign a unique translation key, as well as the standard english translation for this scene's title using this method, anywhere inside the program function.- Specified by:
titlein interfaceSceneBuilder- Parameters:
sceneId- unique ID for this scene, used as a prefix for translation entriestitle- title for this scene, in english
-
configureBasePlate
public void configureBasePlate(int xOffset, int zOffset, int basePlateSize) Description copied from interface:SceneBuilderCommunicates to the ponder UI which parts of the schematic make up the base horizontally. Use of this is encouraged whenever there are components outside the base plate.
As a result, showBasePlate() will only show the configured size, and the scene's scaling inside the UI will be consistent with its base size.- Specified by:
configureBasePlatein interfaceSceneBuilder- Parameters:
xOffset- Block spaces between the base plate and the schematic boundary on the Western side.zOffset- Block spaces between the base plate and the schematic boundary on the Northern side.basePlateSize- Length in blocks of the base plate itself. Ponder assumes it to be square
-
scaleSceneView
public void scaleSceneView(float factor) Description copied from interface:SceneBuilderUse this in case you are not happy with the scale of the scene relative to the overlay- Specified by:
scaleSceneViewin interfaceSceneBuilder- Parameters:
factor- >1 will make the scene appear larger, smaller otherwise
-
removeShadow
public void removeShadow()Description copied from interface:SceneBuilderUse this to disable the base plate's shadow for this scene- Specified by:
removeShadowin interfaceSceneBuilder
-
setSceneOffsetY
public void setSceneOffsetY(float yOffset) Description copied from interface:SceneBuilderUse this in case you are not happy with the vertical alignment of the scene relative to the overlay- Specified by:
setSceneOffsetYin interfaceSceneBuilder- Parameters:
yOffset- >0 moves the scene up, down otherwise
-
showBasePlate
public void showBasePlate()Description copied from interface:SceneBuilderFade the layer of blocks into the scene ponder assumes to be the base plate of the schematic's structure. Makes for a nice opener- Specified by:
showBasePlatein interfaceSceneBuilder
-
addInstruction
Description copied from interface:SceneBuilderAdds an instruction to the scene. It is recommended to only use this method if another method in this class or its subclasses does not already allow adding a certain instruction.- Specified by:
addInstructionin interfaceSceneBuilder
-
addInstruction
Description copied from interface:SceneBuilderAdds a simple instruction to the scene. It is recommended to only use this method if another method in this class or its subclasses does not already allow adding a certain instruction.- Specified by:
addInstructionin interfaceSceneBuilder
-
idle
public void idle(int ticks) Description copied from interface:SceneBuilderBefore running the upcoming instructions, wait for a duration to let previous actions play out.
Idle does not stall any animations, only schedules a time gap between instructions.- Specified by:
idlein interfaceSceneBuilder- Parameters:
ticks- Ticks to wait for
-
idleSeconds
public void idleSeconds(int seconds) Description copied from interface:SceneBuilderBefore running the upcoming instructions, wait for a duration to let previous actions play out.
Idle does not stall any animations, only schedules a time gap between instructions.- Specified by:
idleSecondsin interfaceSceneBuilder- Parameters:
seconds- Seconds to wait for
-
markAsFinished
public void markAsFinished()Description copied from interface:SceneBuilderOnce the scene reaches this instruction in the timeline, mark it as "finished". This happens automatically when the end of a storyboard is reached, but can be desirable to do earlier, in order to bypass the wait for any residual text windows to time out.
So far this event only affects the "next scene" button in the UI to flash.- Specified by:
markAsFinishedin interfaceSceneBuilder
-
setNextUpEnabled
public void setNextUpEnabled(boolean isEnabled) Description copied from interface:SceneBuilderControl whether the "next scene" popup should be displayed for this scene once the previous scene has finished running all of its instructions.- Specified by:
setNextUpEnabledin interfaceSceneBuilder
-
rotateCameraY
public void rotateCameraY(float degrees) Description copied from interface:SceneBuilderPans the scene's camera view around the vertical axis by the given amount- Specified by:
rotateCameraYin interfaceSceneBuilder
-
addKeyframe
public void addKeyframe()Description copied from interface:SceneBuilderAdds a Key Frame at the end of the last delay() instruction for the users to skip to- Specified by:
addKeyframein interfaceSceneBuilder
-
addLazyKeyframe
public void addLazyKeyframe()Description copied from interface:SceneBuilderAdds a Key Frame a couple ticks after the last delay() instruction for the users to skip to- Specified by:
addLazyKeyframein interfaceSceneBuilder
-