BlueGit

timfa frameworkv3

Added child scaling

timfa wsadhelios · pushed by timfa

Authored 2022-10-15 · 4 years ago

Hash
693256273ca956e89734b4a36166068ce2eefc8a
Parent
40dfccf8
1 file changed +4 −0
framework/engine/scene.js +4 −0
@@ -111,7 +111,11 @@ class Scene
111 111 {
112 112 if(this.parentScene)
113 113 {
114 this.real_position.x = this.parentScene.real_position.x + (this.position.x * this.parentScene.real_size.x);
115 this.real_position.y = this.parentScene.real_position.y + (this.position.y * this.parentScene.real_size.y);
114 116
117 this.real_size.x = this.parentScene.real_size.x * this.size.x;
118 this.real_size.y = this.parentScene.real_size.y * this.size.y;
115 119 }
116 120 else
117 121 {
@@ -111,7 +111,11 @@ class Scene
111 {
111 {
112 if(this.parentScene)
112 if(this.parentScene)
113 {
113 {
114 this.real_position.x = this.parentScene.real_position.x + (this.position.x * this.parentScene.real_size.x);
115 this.real_position.y = this.parentScene.real_position.y + (this.position.y * this.parentScene.real_size.y);
114
116
117 this.real_size.x = this.parentScene.real_size.x * this.size.x;
118 this.real_size.y = this.parentScene.real_size.y * this.size.y;
115 }
119 }
116 else
120 else
117 {
121 {