Skip to content

Commit

Permalink
start fullscreen, instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
LingDong- committed Sep 15, 2020
1 parent 6412291 commit b63e179
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,11 @@ Put sketches in `Contents/Resources/app/sketches/`. Each sketch should be in its

## Compiling the app from source

1. Download `nodejs` `npm`
1. Download `nodejs`and `npm`, e.g. `brew install node`.
2. `cd` into the folder and run `npm install` to install all dependencies automatically.
3. `npm start` to fire up the electron app.

### To make standalone app

1. Download `electron-packager`, e.g. `npm install -g electron-packager`
2. `electron-packager .` the "dot" means current directory.
7 changes: 6 additions & 1 deletion renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,20 @@ var SETTINGS = {
FRAME_STYLE:"",
BODY_STYLE:"",
BG_COLOR:[0,0,0],
START_FULLSCREEN:false,
}

function loadSettings(){
Object.assign(SETTINGS,JSON.parse(fs.readFileSync("settings.json").toString()));
updateStyle();
ifr.width = SETTINGS.FRAME_W;
ifr.height = SETTINGS.FRAME_H;

if (SETTINGS.START_FULLSCREEN){
var win = remote.getCurrentWindow();
win.setFullScreen(true);
}
}

function saveSettings(){
fs.writeFileSync("settings.json",JSON.stringify(SETTINGS,null,2));
}
Expand Down
3 changes: 2 additions & 1 deletion settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
0,
0,
0
]
],
"START_FULLSCREEN": false
}

0 comments on commit b63e179

Please sign in to comment.