Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
image.height = "180px"
}
image.paddingBottom = "10px"
stackPanel.addControl(image)
text.height = "56px" // was 30px in Holographic button, but wanted bigger text.
stackPanel.addControl(text)
this.button3D.content = stackPanel
} else if (text) {
this.button3D.content = text
} else if (image) {
// Scale the image to fill the container but maintain aspect ratio. Default is STRETCH_FILL
image.stretch = BabylonImage.STRETCH_UNIFORM
image.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER
this.button3D.contentScaleRatio = 1
this.button3D.content = image
}
if (this.props.onClick) {
// onPointerClickObservable has some issues...
this.button3D.onPointerDownObservable.add(() => {
this.props.onClick(this.button3D!)
})
}
return this.button3D
}