Package emi.dev.emi.emi.runtime
Class EmiScreenshotRecorder
java.lang.Object
emi.dev.emi.emi.runtime.EmiScreenshotRecorder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidsaveScreenshot(String path, int width, int height, Runnable renderer) Saves a screenshot to the game's `screenshots` directory, doing the appropriate setup so that anything rendered in renderer will be captured and saved.
-
Constructor Details
-
EmiScreenshotRecorder
public EmiScreenshotRecorder()
-
-
Method Details
-
saveScreenshot
Saves a screenshot to the game's `screenshots` directory, doing the appropriate setup so that anything rendered in renderer will be captured and saved.Note: the path can have
/characters, indicating subdirectories. Java handles these correctly on Windows. The path should not contain the.pngextension, as that will be added after checking for duplicates. If a file with this path already exists, then path will be suffixed with a_#, before adding the.pngextension, where#represents an increasing number to avoid conflicts.Note 2: The width and height parameters are reflected in the viewport when rendering. But the EMI-config
ui.recipe-screenshot-scalevalue causes the resulting image to be scaled.- Parameters:
path- the path to save the screenshot to, without extension.width- the width of the screenshot, not counting EMI-config scale.height- the height of the screenshot, not counting EMI-config scale.renderer- a function to render the things being screenshotted.
-