-
Select video driver:
-
- WebGL
- WebGL 2
-
@@ -283,6 +278,14 @@
Important - Please read before continuing
+
Video driver:
+
+ Auto
+ WebGL
+ WebGL 2
+
+
+
Preload project ZIP:
(Try this for example)
@@ -348,7 +351,7 @@
Important - Please read before continuing
var game = null;
var setStatusMode;
var setStatusNotice;
- var video_driver = "GLES2";
+ var video_driver = "";
function clearPersistence() {
function deleteDB(path) {
@@ -479,6 +482,15 @@
Important - Please read before continuing
animationCallbacks.push(adjustCanvasDimensions);
adjustCanvasDimensions();
+ function replaceCanvas(from) {
+ const out = document.createElement("canvas");
+ out.id = from.id;
+ out.tabIndex = from.tabIndex;
+ from.parentNode.replaceChild(out, from);
+ lastScale = 0;
+ return out;
+ }
+
setStatusMode = function setStatusMode(mode) {
if (statusMode === mode || !initializing)
return;
@@ -534,6 +546,7 @@
Important - Please read before continuing
'canvas': gameCanvas,
'canvasResizePolicy': 1,
'onExit': function () {
+ gameCanvas = replaceCanvas(gameCanvas);
setGameTabEnabled(false);
showTab('editor');
game = null;
@@ -548,7 +561,7 @@
Important - Please read before continuing
const is_editor = args.filter(function(v) { return v == '--editor' || v == '-e' }).length != 0;
const is_project_manager = args.filter(function(v) { return v == '--project-manager' }).length != 0;
const is_game = !is_editor && !is_project_manager;
- if (is_project_manager) {
+ if (video_driver) {
args.push('--video-driver', video_driver);
}
if (is_game) {
@@ -561,7 +574,7 @@
Important - Please read before continuing
showTab('game');
game.init().then(function() {
requestAnimationFrame(function() {
- game.start({'args': args}).then(function() {
+ game.start({'args': args, 'canvas': gameCanvas}).then(function() {
gameCanvas.focus();
});
});
@@ -576,7 +589,7 @@
Important - Please read before continuing
showTab('loader');
setLoaderEnabled(true);
};
- editor.start({'args': args, 'persistentDrops': is_project_manager});
+ editor.start({'args': args, 'persistentDrops': is_project_manager, 'canvas': editorCanvas});
});
}, 0);
OnEditorExit = null;
@@ -603,6 +616,7 @@
Important - Please read before continuing
'canvas': editorCanvas,
'canvasResizePolicy': 0,
'onExit': function() {
+ editorCanvas = replaceCanvas(editorCanvas);
if (OnEditorExit) {
OnEditorExit();
}
@@ -634,10 +648,14 @@
Important - Please read before continuing
} catch(e) {
// File exists
}
- //selectVideoMode();
+ selectVideoMode();
showTab('editor');
setLoaderEnabled(false);
- editor.start({'args': ['--project-manager', '--video-driver', video_driver], 'persistentDrops': true}).then(function() {
+ const args = ['--project-manager'];
+ if (video_driver) {
+ args.push('--video-driver', video_driver);
+ }
+ editor.start({'args': args, 'persistentDrops': true}).then(function() {
setStatusMode('hidden');
initializing = false;
});