Skip to content

Latest commit

 

History

History
30 lines (17 loc) · 1.52 KB

screenshots.md

File metadata and controls

30 lines (17 loc) · 1.52 KB

Screenshots

Flax supports in-build screenshots taking utilities. You game capture the contents of the render target or the scene rendering task output and save it to file.

Example code

Here is an example usage code that captures the screenshot of the game viewport and saves it to file.

// Pick a path to the output file
var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "screenshot.png");

// Capture game screen to file (done in async)
FlaxEngine.Screenshot.Capture(MainRenderTask.Instance, path);

You can also use the in-build feature to render targets capturing and save the GPU texture to the file. The capture method will create an async task that will download the data from the GPU texture back to the CPU staging texture and save it to the file. If you're using the staging textures manually the capture methods work immediately on that data.

This feature works both in Editor and at runtime on all su

In Editor

Editor Viewport Screenshot

To take a screenshot of the focused game view or game edit view you can use F12 key or main menu option Tools -> Take Screenshot.

Game Viewport Screenshot

If you want to take high-resolution screenshot of the game viewport you can right-click on the dock window tab and use the option to increase the resolution scale (eg. to 2) and then use additional option for screenshot taking. Saved images are stored in the project folder/Screenshots directory.