BlueGit

blue-star speeltuin

Get subbuttons from menuManager

timfa wsadhelios · pushed by timfa

Authored 2022-10-22 · 4 years ago

Hash
a743c0b97cf92e968e90ac05fcc852fd78bfd37c
Parent
980e68d2
5 files changed +77 −31
build/framework.js +6 −2
@@ -55,7 +55,6 @@ class Game
55 55 {
56 56 const promises = [];
57 57 const context = this;
58 console.log(imagesData);
59 58
60 59 for (var imageData of imagesData)
61 60 {
@@ -86,7 +85,7 @@ class Game
86 85 }
87 86 await Promise.all(promises);
88 87
89 console.log("all images loaded");
88 console.log("all images loaded ", this.images);
90 89
91 90 return this.images;
92 91 }
@@ -857,6 +856,11 @@ class Scene
857 856
858 857 this.removeCanvas();
859 858
859 if (this.primary && this.parentScene)
860 {
861 this.parentScene.setPrimary();
862 }
863
860 864 this.destroyed = true;
861 865 }
862 866 }
@@ -55,7 +55,6 @@ class Game
55 {
55 {
56 const promises = [];
56 const promises = [];
57 const context = this;
57 const context = this;
58 console.log(imagesData);
59
58
60 for (var imageData of imagesData)
59 for (var imageData of imagesData)
61 {
60 {
@@ -86,7 +85,7 @@ class Game
86 }
85 }
87 await Promise.all(promises);
86 await Promise.all(promises);
88
87
89 console.log("all images loaded");
88 console.log("all images loaded ", this.images);
90
89
91 return this.images;
90 return this.images;
92 }
91 }
@@ -857,6 +856,11 @@ class Scene
857
856
858 this.removeCanvas();
857 this.removeCanvas();
859
858
859 if (this.primary && this.parentScene)
860 {
861 this.parentScene.setPrimary();
862 }
863
860 this.destroyed = true;
864 this.destroyed = true;
861 }
865 }
862 }
866 }
src/minigame/frog/frogScene.js +13 −1
@@ -29,6 +29,8 @@ class FrogScene extends Scene
29 29
30 30 externalFruitCurrentPos = null;
31 31
32 windowDestroyTweens = [];
33
32 34 constructor (x, y, width, height, displayMode = 0)
33 35 {
34 36 super(x, y, width, height, displayMode);
@@ -71,7 +73,17 @@ class FrogScene extends Scene
71 73 {
72 74 return;
73 75 }
74 this.destroy();
76 if (this.windowDestroyTweens.length > 0)
77 {
78 let gameButton = MenuManager.Instance.getSubButton("btnGames");
79
80 gameButton.moveToOpen(() => gameButton.moveToClose());
81
82 this.windowDestroyTweens.forEach(t => t.start());
83 this.windowDestroyTweens[0].onComplete(() => this.destroy());
84
85 this.windowDestroyTweens = [];
86 }
75 87 }
76 88 }
77 89
@@ -29,6 +29,8 @@ class FrogScene extends Scene
29
29
30 externalFruitCurrentPos = null;
30 externalFruitCurrentPos = null;
31
31
32 windowDestroyTweens = [];
33
32 constructor (x, y, width, height, displayMode = 0)
34 constructor (x, y, width, height, displayMode = 0)
33 {
35 {
34 super(x, y, width, height, displayMode);
36 super(x, y, width, height, displayMode);
@@ -71,7 +73,17 @@ class FrogScene extends Scene
71 {
73 {
72 return;
74 return;
73 }
75 }
74 this.destroy();
76 if (this.windowDestroyTweens.length > 0)
77 {
78 let gameButton = MenuManager.Instance.getSubButton("btnGames");
79
80 gameButton.moveToOpen(() => gameButton.moveToClose());
81
82 this.windowDestroyTweens.forEach(t => t.start());
83 this.windowDestroyTweens[0].onComplete(() => this.destroy());
84
85 this.windowDestroyTweens = [];
86 }
75 }
87 }
76 }
88 }
77
89
src/minigame/minigameInitialiser.js +21 −4
@@ -10,25 +10,42 @@ class MinigameInitialiser
10 10 subScene.position = originVector.getCopy();
11 11 subScene.size = originSize.getCopy();
12 12
13 this.WindowTween(subScene, endPos, endSize, 1000);
13 this.SpawnWindowTween(subScene, endPos, endSize, 1000);
14 14
15 15 subScene.gameSpeed = 1;
16 16
17 subScene.windowDestroyTweens = this.DestroyWindowTween(subScene, originVector, originSize, 600);
18
17 19 parentScene.loadChildScene(subScene);
20
21 subScene.setPrimary();
18 22 }
19 23
20 static WindowTween (scene, endPosition, endSize, length)
24
25 static SpawnWindowTween (scene, endPosition, endSize, length)
21 26 {
22 27 new TWEEN.Tween(scene.position)
23 28 .to({ x: endPosition.x, y: endPosition.y }, length)
24 29 .easing(TWEEN.Easing.Elastic.Out)
25 .onUpdate((s) => console.log(scene.position))
26 30 .start();
27 31
28 32 new TWEEN.Tween(scene.size)
29 33 .to({ x: endSize.x, y: endSize.y }, length)
30 34 .easing(TWEEN.Easing.Elastic.Out)
31 .onUpdate((s) => console.log(scene.position))
32 35 .start();
33 36 }
37
38
39 static DestroyWindowTween (scene, endPosition, endSize, length)
40 {
41 return [
42 new TWEEN.Tween(scene.position)
43 .to({ x: endPosition.x, y: endPosition.y }, length)
44 .easing(TWEEN.Easing.Cubic.Out),
45
46 new TWEEN.Tween(scene.size)
47 .to({ x: endSize.x, y: endSize.y }, length)
48 .easing(TWEEN.Easing.Cubic.Out)
49 ];
50 }
34 51 }
@@ -10,25 +10,42 @@ class MinigameInitialiser
10 subScene.position = originVector.getCopy();
10 subScene.position = originVector.getCopy();
11 subScene.size = originSize.getCopy();
11 subScene.size = originSize.getCopy();
12
12
13 this.WindowTween(subScene, endPos, endSize, 1000);
13 this.SpawnWindowTween(subScene, endPos, endSize, 1000);
14
14
15 subScene.gameSpeed = 1;
15 subScene.gameSpeed = 1;
16
16
17 subScene.windowDestroyTweens = this.DestroyWindowTween(subScene, originVector, originSize, 600);
18
17 parentScene.loadChildScene(subScene);
19 parentScene.loadChildScene(subScene);
20
21 subScene.setPrimary();
18 }
22 }
19
23
20 static WindowTween (scene, endPosition, endSize, length)
24
25 static SpawnWindowTween (scene, endPosition, endSize, length)
21 {
26 {
22 new TWEEN.Tween(scene.position)
27 new TWEEN.Tween(scene.position)
23 .to({ x: endPosition.x, y: endPosition.y }, length)
28 .to({ x: endPosition.x, y: endPosition.y }, length)
24 .easing(TWEEN.Easing.Elastic.Out)
29 .easing(TWEEN.Easing.Elastic.Out)
25 .onUpdate((s) => console.log(scene.position))
26 .start();
30 .start();
27
31
28 new TWEEN.Tween(scene.size)
32 new TWEEN.Tween(scene.size)
29 .to({ x: endSize.x, y: endSize.y }, length)
33 .to({ x: endSize.x, y: endSize.y }, length)
30 .easing(TWEEN.Easing.Elastic.Out)
34 .easing(TWEEN.Easing.Elastic.Out)
31 .onUpdate((s) => console.log(scene.position))
32 .start();
35 .start();
33 }
36 }
37
38
39 static DestroyWindowTween (scene, endPosition, endSize, length)
40 {
41 return [
42 new TWEEN.Tween(scene.position)
43 .to({ x: endPosition.x, y: endPosition.y }, length)
44 .easing(TWEEN.Easing.Cubic.Out),
45
46 new TWEEN.Tween(scene.size)
47 .to({ x: endSize.x, y: endSize.y }, length)
48 .easing(TWEEN.Easing.Cubic.Out)
49 ];
50 }
34}
51}
src/objects/menus/btnGames.js +23 −15
@@ -18,38 +18,47 @@ class BtnGames extends GameObject
18 18 MenuManager.Instance.isClosed.add(() => this.moveToClose(), this);
19 19 }
20 20
21 getSubButton (label)
22 {
23 return this.buttons.filter(e => e.label == label)[0];
24 }
25
21 26 initializeButtons ()
22 27 {
23 this.createSubButton(this.scene.game.images.btnFrog, function ()
28 this.createSubButton("btnFrog", this.scene.game.images.btnFrog, function ()
24 29 {
25 MinigameInitialiser.StartFrogGame(this.scene, this.transform.position, this.transform.size);
30 MinigameInitialiser.StartFrogGame(this.scene, new vector(this.transform.position.x - this.transform.size.x / 2, this.transform.position.y - this.transform.size.y / 2), this.transform.size);
26 31 MenuManager.Instance.moveToClose();
27 32
28 33 });
29 34
30 35 for (let i = 0; i < this.buttons.length; i++)
31 36 {
37 let current = this.buttons[i].button;
38
32 39 if (i == 0)
33 40 {
34 this.buttons[i].endPos = new vector(this.transform.position.x + this.transform.size.x * 2 + this.buttonPadding, this.transform.position.y + this.buttonPadding);
41 current.endPos = new vector(this.transform.position.x + this.transform.size.x * 2 + this.buttonPadding, this.transform.position.y + this.buttonPadding);
35 42 }
36 43 else
37 44 {
38 this.buttons[i].endPos = new vector(
39 this.buttons[i - 1].endPos.x,
40 this.buttons[i - 1].endPos.y + this.buttons[i - 1].transform.size.y + this.buttonPadding);
45 let previous = this.buttons[i - 1].button;
46
47 current.endPos = new vector(
48 previous.endPos.x,
49 previous.endPos.y + previous.transform.size.y + this.buttonPadding);
41 50 }
42 51 }
43 52 }
44 53
45 createSubButton (image, onClick)
54 createSubButton (label, image, onClick)
46 55 {
47 56 let button = new GameObject(this.subBtnStartPosX, this.transform.position.y, image, 3);
48 57 this.scene.addObject(button);
49 58 button.startPos = new vector(-32, this.transform.position.y);
50 59 button.onClick = onClick;
51 60
52 this.buttons.push(button);
61 this.buttons.push({ label: label, button: button });
53 62 }
54 63
55 64 onClick (btn)
@@ -59,21 +68,21 @@ class BtnGames extends GameObject
59 68 this.moveToClose();
60 69 }
61 70
62 moveToOpen ()
71 moveToOpen (onDone)
63 72 {
64 73 if (this.state == MenuManager.States.open)
65 74 return;
66 75
67 76 this.state = MenuManager.States.open;
68 this.buttons.forEach(e => this.createOpenTween(e.transform.position, { x: [e.endPos.x], y: [e.startPos.y, e.startPos.y, e.startPos.y, e.endPos.y] }, 500).start());
77 this.buttons.forEach(e => this.createOpenTween(e.button.transform.position, { x: [e.button.endPos.x], y: [e.button.startPos.y, e.button.startPos.y, e.button.startPos.y, e.button.endPos.y] }, 500).start().onComplete(() => onDone && onDone.call()));
69 78 }
70 79
71 moveToClose ()
80 moveToClose (onDone)
72 81 {
73 82 if (this.state == MenuManager.States.closed)
74 83 return;
75 84 this.state = MenuManager.States.closed;
76 this.buttons.forEach(e => this.createCloseTween(e.transform.position, { x: [e.endPos.x, e.endPos.x, e.endPos.x, e.endPos.x, e.startPos.x], y: [e.startPos.y] }, 1000).start());
85 this.buttons.forEach(e => this.createCloseTween(e.button.transform.position, { x: [e.button.endPos.x, e.button.endPos.x, e.button.endPos.x, e.button.endPos.x, e.button.startPos.x], y: [e.button.startPos.y] }, 1000).start().onComplete(() => onDone && onDone.call()));
77 86 }
78 87
79 88 createOpenTween (target, newTarget, length)
@@ -82,8 +91,7 @@ class BtnGames extends GameObject
82 91 .to(newTarget, length)
83 92 .onUpdate(() =>
84 93 {
85 this.updateButtonPosition && this.updateButtonPosition();
86 this.buttons.forEach(e => e.onUpdate && e.onUpdate());
94 this.buttons.forEach(e => e.button.onUpdate && e.button.onUpdate());
87 95 })
88 96 .easing(TWEEN.Easing.Back.Out);
89 97 }
@@ -95,7 +103,7 @@ class BtnGames extends GameObject
95 103 .onUpdate(() =>
96 104 {
97 105 this.updateButtonPosition && this.updateButtonPosition();
98 this.buttons.forEach(e => e.onUpdate && e.onUpdate());
106 this.buttons.forEach(e => e.button.onUpdate && e.button.onUpdate());
99 107 })
100 108 .easing(TWEEN.Easing.Quintic.Out);
101 109 }
@@ -18,38 +18,47 @@ class BtnGames extends GameObject
18 MenuManager.Instance.isClosed.add(() => this.moveToClose(), this);
18 MenuManager.Instance.isClosed.add(() => this.moveToClose(), this);
19 }
19 }
20
20
21 getSubButton (label)
22 {
23 return this.buttons.filter(e => e.label == label)[0];
24 }
25
21 initializeButtons ()
26 initializeButtons ()
22 {
27 {
23 this.createSubButton(this.scene.game.images.btnFrog, function ()
28 this.createSubButton("btnFrog", this.scene.game.images.btnFrog, function ()
24 {
29 {
25 MinigameInitialiser.StartFrogGame(this.scene, this.transform.position, this.transform.size);
30 MinigameInitialiser.StartFrogGame(this.scene, new vector(this.transform.position.x - this.transform.size.x / 2, this.transform.position.y - this.transform.size.y / 2), this.transform.size);
26 MenuManager.Instance.moveToClose();
31 MenuManager.Instance.moveToClose();
27
32
28 });
33 });
29
34
30 for (let i = 0; i < this.buttons.length; i++)
35 for (let i = 0; i < this.buttons.length; i++)
31 {
36 {
37 let current = this.buttons[i].button;
38
32 if (i == 0)
39 if (i == 0)
33 {
40 {
34 this.buttons[i].endPos = new vector(this.transform.position.x + this.transform.size.x * 2 + this.buttonPadding, this.transform.position.y + this.buttonPadding);
41 current.endPos = new vector(this.transform.position.x + this.transform.size.x * 2 + this.buttonPadding, this.transform.position.y + this.buttonPadding);
35 }
42 }
36 else
43 else
37 {
44 {
38 this.buttons[i].endPos = new vector(
45 let previous = this.buttons[i - 1].button;
39 this.buttons[i - 1].endPos.x,
46
40 this.buttons[i - 1].endPos.y + this.buttons[i - 1].transform.size.y + this.buttonPadding);
47 current.endPos = new vector(
48 previous.endPos.x,
49 previous.endPos.y + previous.transform.size.y + this.buttonPadding);
41 }
50 }
42 }
51 }
43 }
52 }
44
53
45 createSubButton (image, onClick)
54 createSubButton (label, image, onClick)
46 {
55 {
47 let button = new GameObject(this.subBtnStartPosX, this.transform.position.y, image, 3);
56 let button = new GameObject(this.subBtnStartPosX, this.transform.position.y, image, 3);
48 this.scene.addObject(button);
57 this.scene.addObject(button);
49 button.startPos = new vector(-32, this.transform.position.y);
58 button.startPos = new vector(-32, this.transform.position.y);
50 button.onClick = onClick;
59 button.onClick = onClick;
51
60
52 this.buttons.push(button);
61 this.buttons.push({ label: label, button: button });
53 }
62 }
54
63
55 onClick (btn)
64 onClick (btn)
@@ -59,21 +68,21 @@ class BtnGames extends GameObject
59 this.moveToClose();
68 this.moveToClose();
60 }
69 }
61
70
62 moveToOpen ()
71 moveToOpen (onDone)
63 {
72 {
64 if (this.state == MenuManager.States.open)
73 if (this.state == MenuManager.States.open)
65 return;
74 return;
66
75
67 this.state = MenuManager.States.open;
76 this.state = MenuManager.States.open;
68 this.buttons.forEach(e => this.createOpenTween(e.transform.position, { x: [e.endPos.x], y: [e.startPos.y, e.startPos.y, e.startPos.y, e.endPos.y] }, 500).start());
77 this.buttons.forEach(e => this.createOpenTween(e.button.transform.position, { x: [e.button.endPos.x], y: [e.button.startPos.y, e.button.startPos.y, e.button.startPos.y, e.button.endPos.y] }, 500).start().onComplete(() => onDone && onDone.call()));
69 }
78 }
70
79
71 moveToClose ()
80 moveToClose (onDone)
72 {
81 {
73 if (this.state == MenuManager.States.closed)
82 if (this.state == MenuManager.States.closed)
74 return;
83 return;
75 this.state = MenuManager.States.closed;
84 this.state = MenuManager.States.closed;
76 this.buttons.forEach(e => this.createCloseTween(e.transform.position, { x: [e.endPos.x, e.endPos.x, e.endPos.x, e.endPos.x, e.startPos.x], y: [e.startPos.y] }, 1000).start());
85 this.buttons.forEach(e => this.createCloseTween(e.button.transform.position, { x: [e.button.endPos.x, e.button.endPos.x, e.button.endPos.x, e.button.endPos.x, e.button.startPos.x], y: [e.button.startPos.y] }, 1000).start().onComplete(() => onDone && onDone.call()));
77 }
86 }
78
87
79 createOpenTween (target, newTarget, length)
88 createOpenTween (target, newTarget, length)
@@ -82,8 +91,7 @@ class BtnGames extends GameObject
82 .to(newTarget, length)
91 .to(newTarget, length)
83 .onUpdate(() =>
92 .onUpdate(() =>
84 {
93 {
85 this.updateButtonPosition && this.updateButtonPosition();
94 this.buttons.forEach(e => e.button.onUpdate && e.button.onUpdate());
86 this.buttons.forEach(e => e.onUpdate && e.onUpdate());
87 })
95 })
88 .easing(TWEEN.Easing.Back.Out);
96 .easing(TWEEN.Easing.Back.Out);
89 }
97 }
@@ -95,7 +103,7 @@ class BtnGames extends GameObject
95 .onUpdate(() =>
103 .onUpdate(() =>
96 {
104 {
97 this.updateButtonPosition && this.updateButtonPosition();
105 this.updateButtonPosition && this.updateButtonPosition();
98 this.buttons.forEach(e => e.onUpdate && e.onUpdate());
106 this.buttons.forEach(e => e.button.onUpdate && e.button.onUpdate());
99 })
107 })
100 .easing(TWEEN.Easing.Quintic.Out);
108 .easing(TWEEN.Easing.Quintic.Out);
101 }
109 }
src/objects/menus/menuManager.js +14 −9
@@ -31,6 +31,11 @@ class MenuManager extends GameObject
31 31 this.closeTween = this.createCloseTween(this.transform.position, { x: -15 }, this.closeTweenTime);
32 32 }
33 33
34 getSubButton (label)
35 {
36 return this.buttons.filter(e => e.label == label)[0].button;
37 }
38
34 39 addedToScene ()
35 40 {
36 41 this.isOpened = new Signal();
@@ -40,10 +45,10 @@ class MenuManager extends GameObject
40 45 this.moveToOpen(() => this.moveToClose());
41 46 this.buttons =
42 47 [
43 this.scene.addObject(new BtnFruit(0, 0, this.scene.game.images.btnFruit, 4)),
44 this.scene.addObject(new BtnToys(0, 0, this.scene.game.images.btnToys, 4)),
45 this.scene.addObject(new BtnGames(0, 0, this.scene.game.images.btnGames, 4)),
46 this.scene.addObject(new BtnPlants(0, 0, this.scene.game.images.btnPlants, 4))
48 { label: "btnFruit", button: this.scene.addObject(new BtnFruit(0, 0, this.scene.game.images.btnFruit, 4)) },
49 { label: "btnToys", button: this.scene.addObject(new BtnToys(0, 0, this.scene.game.images.btnToys, 4)) },
50 { label: "btnGames", button: this.scene.addObject(new BtnGames(0, 0, this.scene.game.images.btnGames, 4)) },
51 { label: "btnPlants", button: this.scene.addObject(new BtnPlants(0, 0, this.scene.game.images.btnPlants, 4)) }
47 52 ];
48 53
49 54 this.updateButtonPosition();
@@ -102,7 +107,7 @@ class MenuManager extends GameObject
102 107 .onUpdate(() =>
103 108 {
104 109 this.updateButtonPosition();
105 this.buttons.forEach(e => e.onUpdate && e.onUpdate());
110 this.buttons.forEach(e => e.button.onUpdate && e.button.onUpdate());
106 111 })
107 112 .easing(TWEEN.Easing.Bounce.Out);
108 113 }
@@ -135,13 +140,13 @@ class MenuManager extends GameObject
135 140 {
136 141 if (i == 0)
137 142 {
138 this.buttons[i].transform.position.x = this.transform.position.x + this.buttonXOffset;
139 this.buttons[i].transform.position.y = this.transform.position.y + this.transform.size.y + this.buttonPadding;
143 this.buttons[i].button.transform.position.x = this.transform.position.x + this.buttonXOffset;
144 this.buttons[i].button.transform.position.y = this.transform.position.y + this.transform.size.y + this.buttonPadding;
140 145 }
141 146 else
142 147 {
143 this.buttons[i].transform.position.x = this.transform.position.x + this.buttonXOffset;
144 this.buttons[i].transform.position.y = this.buttons[i - 1].transform.position.y + this.buttons[i - 1].transform.size.y + this.buttonPadding;
148 this.buttons[i].button.transform.position.x = this.transform.position.x + this.buttonXOffset;
149 this.buttons[i].button.transform.position.y = this.buttons[i - 1].button.transform.position.y + this.buttons[i - 1].button.transform.size.y + this.buttonPadding;
145 150 }
146 151 }
147 152 }
@@ -31,6 +31,11 @@ class MenuManager extends GameObject
31 this.closeTween = this.createCloseTween(this.transform.position, { x: -15 }, this.closeTweenTime);
31 this.closeTween = this.createCloseTween(this.transform.position, { x: -15 }, this.closeTweenTime);
32 }
32 }
33
33
34 getSubButton (label)
35 {
36 return this.buttons.filter(e => e.label == label)[0].button;
37 }
38
34 addedToScene ()
39 addedToScene ()
35 {
40 {
36 this.isOpened = new Signal();
41 this.isOpened = new Signal();
@@ -40,10 +45,10 @@ class MenuManager extends GameObject
40 this.moveToOpen(() => this.moveToClose());
45 this.moveToOpen(() => this.moveToClose());
41 this.buttons =
46 this.buttons =
42 [
47 [
43 this.scene.addObject(new BtnFruit(0, 0, this.scene.game.images.btnFruit, 4)),
48 { label: "btnFruit", button: this.scene.addObject(new BtnFruit(0, 0, this.scene.game.images.btnFruit, 4)) },
44 this.scene.addObject(new BtnToys(0, 0, this.scene.game.images.btnToys, 4)),
49 { label: "btnToys", button: this.scene.addObject(new BtnToys(0, 0, this.scene.game.images.btnToys, 4)) },
45 this.scene.addObject(new BtnGames(0, 0, this.scene.game.images.btnGames, 4)),
50 { label: "btnGames", button: this.scene.addObject(new BtnGames(0, 0, this.scene.game.images.btnGames, 4)) },
46 this.scene.addObject(new BtnPlants(0, 0, this.scene.game.images.btnPlants, 4))
51 { label: "btnPlants", button: this.scene.addObject(new BtnPlants(0, 0, this.scene.game.images.btnPlants, 4)) }
47 ];
52 ];
48
53
49 this.updateButtonPosition();
54 this.updateButtonPosition();
@@ -102,7 +107,7 @@ class MenuManager extends GameObject
102 .onUpdate(() =>
107 .onUpdate(() =>
103 {
108 {
104 this.updateButtonPosition();
109 this.updateButtonPosition();
105 this.buttons.forEach(e => e.onUpdate && e.onUpdate());
110 this.buttons.forEach(e => e.button.onUpdate && e.button.onUpdate());
106 })
111 })
107 .easing(TWEEN.Easing.Bounce.Out);
112 .easing(TWEEN.Easing.Bounce.Out);
108 }
113 }
@@ -135,13 +140,13 @@ class MenuManager extends GameObject
135 {
140 {
136 if (i == 0)
141 if (i == 0)
137 {
142 {
138 this.buttons[i].transform.position.x = this.transform.position.x + this.buttonXOffset;
143 this.buttons[i].button.transform.position.x = this.transform.position.x + this.buttonXOffset;
139 this.buttons[i].transform.position.y = this.transform.position.y + this.transform.size.y + this.buttonPadding;
144 this.buttons[i].button.transform.position.y = this.transform.position.y + this.transform.size.y + this.buttonPadding;
140 }
145 }
141 else
146 else
142 {
147 {
143 this.buttons[i].transform.position.x = this.transform.position.x + this.buttonXOffset;
148 this.buttons[i].button.transform.position.x = this.transform.position.x + this.buttonXOffset;
144 this.buttons[i].transform.position.y = this.buttons[i - 1].transform.position.y + this.buttons[i - 1].transform.size.y + this.buttonPadding;
149 this.buttons[i].button.transform.position.y = this.buttons[i - 1].button.transform.position.y + this.buttons[i - 1].button.transform.size.y + this.buttonPadding;
145 }
150 }
146 }
151 }
147 }
152 }