|
@@ -3489,6 +3489,19 @@ var BABYLON;
|
|
|
result.addControl(textBlock);
|
|
|
return result;
|
|
|
};
|
|
|
+ Button.CreateImageWithCenterTextButton = function (name, text, imageUrl) {
|
|
|
+ var result = new Button(name);
|
|
|
+ // Adding image
|
|
|
+ var iconImage = new BABYLON.GUI.Image(name + "_icon", imageUrl);
|
|
|
+ iconImage.stretch = BABYLON.GUI.Image.STRETCH_FILL;
|
|
|
+ result.addControl(iconImage);
|
|
|
+ // Adding text
|
|
|
+ var textBlock = new BABYLON.GUI.TextBlock(name + "_button", text);
|
|
|
+ textBlock.textWrapping = true;
|
|
|
+ textBlock.textHorizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_CENTER;
|
|
|
+ result.addControl(textBlock);
|
|
|
+ return result;
|
|
|
+ };
|
|
|
return Button;
|
|
|
}(GUI.Rectangle));
|
|
|
GUI.Button = Button;
|