BlueGit

timfa frameworkv3

onLoad()

timfa Tim · pushed by timfa

Authored 2022-10-15 · 4 years ago

Hash
8c0958f26afafe9fea5c16995aab8dba836436c7
Parent
8c9dd7f2
2 files changed +6 −0
framework/engine/game.js +1 −0
@@ -19,6 +19,7 @@ class Game
19 19 {
20 20 this.activeScenes.push(scene);
21 21 scene.game = this;
22 scene.onLoad();
22 23 }
23 24
24 25 update()
@@ -19,6 +19,7 @@ class Game
19 {
19 {
20 this.activeScenes.push(scene);
20 this.activeScenes.push(scene);
21 scene.game = this;
21 scene.game = this;
22 scene.onLoad();
22 }
23 }
23
24
24 update()
25 update()
framework/engine/scene.js +5 −0
@@ -39,6 +39,11 @@ class Scene
39 39 this.cv_context = this.cv_canvas.getContext('2d');
40 40 }
41 41
42 onLoad()
43 {
44
45 }
46
42 47 loadChildScene(scene)
43 48 {
44 49 scene.parentScene = this;
@@ -39,6 +39,11 @@ class Scene
39 this.cv_context = this.cv_canvas.getContext('2d');
39 this.cv_context = this.cv_canvas.getContext('2d');
40 }
40 }
41
41
42 onLoad()
43 {
44
45 }
46
42 loadChildScene(scene)
47 loadChildScene(scene)
43 {
48 {
44 scene.parentScene = this;
49 scene.parentScene = this;