Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add screenshot to save file #213

Open
BarthPaleologue opened this issue Dec 15, 2024 · 1 comment
Open

Add screenshot to save file #213

BarthPaleologue opened this issue Dec 15, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@BarthPaleologue
Copy link
Owner

BarthPaleologue commented Dec 15, 2024

When saving the game (in cosmosJourneyer.ts in generateSaveData), create a small screenshot of the game and save it to the save file as a base64 string.

Resource: https://forum.babylonjs.com/t/how-should-i-use-screenshottools-create-screenshot-with-resize-async/55363/2

Then change the loading save panel ui to display the screenshot.

@BarthPaleologue BarthPaleologue added enhancement New feature or request good first issue Good for newcomers labels Dec 15, 2024
@BarthPaleologue
Copy link
Owner Author

How to do it:

  • In SaveFileData

    export type SaveFileData = {
    add a thumbnail stringfield.

  • CosmosJourneyer::generateSaveData, call Tools.CreateScreenshotAsync to the base 64 string for the thumbnail (use a small size parameter, we don't want a 4k image data in the save file)

  • In SaveLoadingPanelContent::createSaveDiv, add an image to display the thumbnail save between the save info on the left and the control buttons on the right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant