joshcamas Posted October 7, 2018 Share Posted October 7, 2018 Hello friends I can't seem to get labels working in 3D GUI. I can get them attached to a button, but I don't need a button xD I need a label Is there a way to get a 3d button with just the "content" feature, with no actual button graphic / interaction? Thanks! Josh Quote Link to comment Share on other sites More sharing options...
Dad72 Posted October 7, 2018 Share Posted October 7, 2018 I use this to create labels on a mesh: createLabel(mesh, name = null) { let labelRectangle["label_"+name] = new BABYLON.GUI.Rectangle("label_"+name); labelRectangle["label_"+name].background = "#d52349"; labelRectangle["label_"+name].height = "14px"; labelRectangle["label_"+name].alpha = 0.8; labelRectangle["label_"+name].width = "100px"; labelRectangle["label_"+name].cornerRadius = 7; labelRectangle["label_"+name].thickness = 1; labelRectangle["label_"+name].isVisible = true; labelRectangle["label_"+name].adaptWidthToChildren = true; this.advancedTextureLabel.addControl(labelRectangle["label_"+name]); labelRectangle["label_"+name].linkWithMesh(mesh); let textEtiquette = new BABYLON.GUI.TextBlock(); textEtiquette.text = " "+name+" "; labelRectangle["label_"+name].width = (textEtiquette.text.length * 10)+"px"; textEtiquette.resizeToFit = true; textEtiquette.color = "white"; textEtiquette.fontSize = 13; textEtiquette.fontFamily = "Source Sans Pro"; labelRectangle["label_"+name].addControl(textEtiquette); } ssaket and joshcamas 2 Quote Link to comment Share on other sites More sharing options...
joshcamas Posted October 7, 2018 Author Share Posted October 7, 2018 Interesting, I'll look into this. Thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.