better build script, scene position
@@ -0,0 +1,17 @@
1
{
2
// See https://go.microsoft.com/fwlink/?LinkId=733558
3
// for the documentation about the tasks.json format
4
"version": "2.0.0",
5
"tasks": [
6
{
7
"label": "Build Framework",
8
"type": "shell",
9
"command": "sh ./framework/build.sh",
10
"problemMatcher": [],
11
"group": {
12
"kind": "build",
13
"isDefault": true
14
}
15
}
16
]
17
}
@@ -0,0 +1,17 @@1
{2
// See https://go.microsoft.com/fwlink/?LinkId=7335583
// for the documentation about the tasks.json format4
"version": "2.0.0",5
"tasks": [6
{7
"label": "Build Framework",8
"type": "shell",9
"command": "sh ./framework/build.sh",10
"problemMatcher": [],11
"group": {12
"kind": "build",13
"isDefault": true14
}15
}16
]17
}@@ -0,0 +1,9 @@
1
unlink ./js/framework.js
2
for i in ./framework/*.js;
3
do
4
printf "\n/*\n * Start File:\n * "$i"\n */ \n" >> ./js/framework.js;
5
printf "Building "$i"\n";
6
cat $i >> ./js/framework.js;
7
printf "\n/*\n * End File:\n * "$i"\n */ \n" >> ./js/framework.js;
8
done
9
printf "DONE"
@@ -0,0 +1,9 @@1
unlink ./js/framework.js2
for i in ./framework/*.js;3
do 4
printf "\n/*\n * Start File:\n * "$i"\n */ \n" >> ./js/framework.js; 5
printf "Building "$i"\n";6
cat $i >> ./js/framework.js; 7
printf "\n/*\n * End File:\n * "$i"\n */ \n" >> ./js/framework.js; 8
done9
printf "DONE"@@ -23,7 +23,7 @@ class Scene
23
23
24
24
let body = document.body;
25
25
26
body.insertAdjacentHTML('beforeend', '<canvas id="canvas_' + Scene.idCount + '" style="position: absolute; left: ' + x + 'px; top: ' + y + 'px; border: 1px solid black;" width="' + GameWindow.width + '" height="' + GameWindow.height + '"></canvas>');
26
body.insertAdjacentHTML('beforeend', '<canvas id="canvas_' + Scene.idCount + '" style="position: absolute; left: ' + x + 'px; top: ' + y + 'px;" width="' + GameWindow.width + '" height="' + GameWindow.height + '"></canvas>');
27
27
28
28
this.cv_canvas = document.getElementById('canvas_' + Scene.idCount);
29
29
this.cv_canvasContext = this.cv_canvas.getContext('2d');
@@ -70,6 +70,8 @@ class Scene
70
70
this.canvas.width = this.size.width;
71
71
this.canvas.height = this.size.height;
72
72
73
this.canvas.style = 'position: absolute; left: ' + this.position.x + 'px; top: ' + this.position.y + 'px;'; //todo: only call when changed?
74
73
75
this.canvasContext.fillStyle = "rgb(" + this.backgroundColor.r + "," + GameWindow.backgroundColor.g + "," + GameWindow.backgroundColor.b + ")"; // sets the color to fill in the rectangle with
74
76
this.canvasContext.fillRect(0, 0, this.size.width, this.size.height);
75
77
@@ -23,7 +23,7 @@ class Scene23
23
24
let body = document.body;
24
let body = document.body;
25
25
26
body.insertAdjacentHTML('beforeend', '<canvas id="canvas_' + Scene.idCount + '" style="position: absolute; left: ' + x + 'px; top: ' + y + 'px; border: 1px solid black;" width="' + GameWindow.width + '" height="' + GameWindow.height + '"></canvas>');
26
body.insertAdjacentHTML('beforeend', '<canvas id="canvas_' + Scene.idCount + '" style="position: absolute; left: ' + x + 'px; top: ' + y + 'px;" width="' + GameWindow.width + '" height="' + GameWindow.height + '"></canvas>');
27
27
28
this.cv_canvas = document.getElementById('canvas_' + Scene.idCount);
28
this.cv_canvas = document.getElementById('canvas_' + Scene.idCount);
29
this.cv_canvasContext = this.cv_canvas.getContext('2d');
29
this.cv_canvasContext = this.cv_canvas.getContext('2d');
@@ -70,6 +70,8 @@ class Scene70
this.canvas.width = this.size.width;
70
this.canvas.width = this.size.width;
71
this.canvas.height = this.size.height;
71
this.canvas.height = this.size.height;
72
72
73
this.canvas.style = 'position: absolute; left: ' + this.position.x + 'px; top: ' + this.position.y + 'px;'; //todo: only call when changed?
74
73
this.canvasContext.fillStyle = "rgb(" + this.backgroundColor.r + "," + GameWindow.backgroundColor.g + "," + GameWindow.backgroundColor.b + ")"; // sets the color to fill in the rectangle with
75
this.canvasContext.fillStyle = "rgb(" + this.backgroundColor.r + "," + GameWindow.backgroundColor.g + "," + GameWindow.backgroundColor.b + ")"; // sets the color to fill in the rectangle with
74
this.canvasContext.fillRect(0, 0, this.size.width, this.size.height);
76
this.canvasContext.fillRect(0, 0, this.size.width, this.size.height);
75
77