Pryme8 Posted August 29, 2018 Share Posted August 29, 2018 So Im sure everyone knows the DPS Messages from most RPG's. Where you hit something and text pops out and fades off showing a value of that event. So this is a two part question... Do we support Image Textmaps, if not then does anyone have any examples of image text that they have worked up. Second part would be with the scene already having one AdvanceDynamicTexture for the UI, what would be the best method of displaying this info? Maybe a dynamic texture that updates the value being displayed then, create a billboard plane that holds a cloned version of the dynamic texture on it, animate the plane and then dispose them both after the animation is done? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 29, 2018 Author Share Posted August 29, 2018 http://www.babylonjs-playground.com/#IU5G4A#4 Just gotta get them displaying text now. Quote Link to comment Share on other sites More sharing options...
QuintusHegie Posted August 29, 2018 Share Posted August 29, 2018 (edited) var makeTextPlane = function(text, color, size) { var dynamicTexture = new BABYLON.DynamicTexture("DynamicTexture", 50, scene, true); dynamicTexture.hasAlpha = true; dynamicTexture.drawText(text, 5, 40, "bold 36px Arial", color , "transparent", true); var plane = new BABYLON.Mesh.CreatePlane("TextPlane", size, scene, true); plane.material = new BABYLON.StandardMaterial("TextPlaneMaterial", scene); plane.material.backFaceCulling = false; plane.material.specularColor = new BABYLON.Color3(0, 0, 0); plane.material.diffuseTexture = dynamicTexture; return plane; }; Something like this? Edited August 29, 2018 by QuintusHegie had a fight with the code editor syntax coloring ;-) Pryme8 and GameMonetize 2 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 29, 2018 Author Share Posted August 29, 2018 http://www.babylonjs-playground.com/#IU5G4A#11 Almost there, needs a little bit of fixing still but yeah. Anyways anyone know the flag I need to set to stop it from turning all black on fractional visibility? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 29, 2018 Author Share Posted August 29, 2018 http://www.babylonjs-playground.com/#IU5G4A#23 Got it. GameMonetize and DylanD 2 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.