Comments (5)
That seems like a good idea to implement in the future! Should I have the screenshot immediately downloaded? Or did you have something else in mind?
from webretro.
I am trying to implement saving game state with screenshot display. When i try to read a file in the virtual file system along the path /home/web_user/retroarch/userdata/screenshots/rom-210621-190311.png, an error occurs.
from webretro.
You may have to put it on a short setTimeout.
from webretro.
I did save screenshot to file:
function takeScreenshot(){
Module._cmd_take_screenshot();
var screenshot_path = "/home/web_user/retroarch/userdata/screenshots/";
var screenshot_name = makeScreenshotFilename();
window.setTimeout(function() {
if(FS.analyzePath(screenshot_path+screenshot_name).exists) {
var file = FS.readFile(screenshot_path+screenshot_name);
downloadFile(file,screenshot_name);
} else {
console.log('screenshot not found')
}
}, 500);
}
function makeScreenshotFilename(){
var now = new Date();
var y = now.getFullYear().toString().slice(-2),
m = ("0" + (now.getMonth() + 1)).slice(-2),
d = ("0" + now.getDate()).slice(-2),
h = ("0" + now.getHours()).slice(-2),
i = ("0" + now.getMinutes()).slice(-2),
s = ("0" + now.getSeconds()).slice(-2);
return `rom-${y}${m}${d}-${h}${i}${s}.png`;
}
from webretro.
Nice! That works very well! I was planning on making a screenshot gallery feature, so that the user could browse their screenshots, and then download them whenever they want. Will be in the next update.
from webretro.
Related Issues (20)
- how do i fast forward? HOT 2
- Major performance increase Audio Fixes HOT 4
- Project Status HOT 3
- States HOT 2
- Functionality Issues HOT 3
- Speed-Up HOT 2
- Can't export Webretro saves
- GBA/GB/GBC games don't let me save HOT 1
- Just a question
- How would I go about making a citra file? HOT 1
- Speed Up/Frame Throttle Not Working
- Sonic colors HOT 12
- question
- Will you add a xbox 360 core??? HOT 3
- Question HOT 2
- Building Core
- Error 0 HOT 4
- HOW DO I SAVE MY SETTINGS AHHH HOT 1
- Load local/server PSX BIOS file? HOT 1
- Stuck on loading screen each time I insert a rom HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webretro.