Skip to main content

ScreenshotTaker

A class in Root.Township, the global namespace.

Static helper that renders the local player's camera at 4x screen size and saves it as an image in the Screenshots storage folder. Client only.

Constructors​

MemberWhat it is
ScreenshotTaker()Creates a ScreenshotTaker with default values.

Fields​

MemberWhat it is
static ScreenshotTaker.ImageFormat imageFormatImage format to save in. Reset to PNG by TakeScreenShot.
static string lastScreenshotPath of the last screenshot file.
static Camera myCameraCamera to render. Set to the local player's camera on each shot.
8 private and internal fields
MemberWhat it is
private static bool isTransparentCaptures with an alpha channel. Always false here.
private static float lastTimeReal time of the last screenshot, for the 10 second cooldown.
private static string overrideNameText put into the file name. Empty by default.
private static string pathFolder screenshots are saved to.
private static int resHeightCapture height: screen height times 4.
private static int resWidthCapture width: screen width times 4.
private static int scaleExtra multiplier on the capture size. Always 1.
private static bool takeHiResShotFlag set by TakeHiResShot and cleared after a shot.

Methods​

MemberWhat it is
static string ScreenShotName(int width, int height)Builds the file path from folder, override name, size, date and format, and stores it in lastScreenshot.
static void TakeHiResShot()Sets the takeHiResShot flag. Nothing in this class reads it.
static void TakeScreenShot()Takes a screenshot from the local player's camera, at most once every 10 seconds.
1 private and internal method
MemberWhat it is
private static void CarryOutShot()Renders the camera into a texture, encodes it as PNG, JPG or TGA, writes the file and opens it.