luka_friend Posted December 9, 2014 Share Posted December 9, 2014 Hi!Does anybody know if there is a way to set color of the plane to transparency?If i set hex value of plane to "#80FFFFFF" (should have 50% transparency) it just becomes black. How can I set not to have background color only BLACK text. Or if I set alpha value to transparent, everything becomes transparent. But I want only transparent background. You can see the problem in the picture (white rectangle - on which text is on is my problem): Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted December 9, 2014 Share Posted December 9, 2014 Hello luka_friend, Have you tried to use the different parameters you can find in BABYLON.StandardMaterial ? Like :myMaterial.diffuseTexture.hasAlpha = true;or / andmyMaterial.useAlphaFromDiffuseTexture = true;instead of myMaterial.alphaOtherwise, can you reproduce your problem in the playground if these parameters don't work ? Thanks RustySharpcloud 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 9, 2014 Share Posted December 9, 2014 http://playground.babylonjs.com/#O4OXG#4 Notice the outputplaneTexture.hasAlpha = true; on the outputplane texture (which is also its diffuseTexture as Luaacro has pointed-out). Also notice the "transparent" as the last parameter in the drawText commands. No promises, here. I'm not very proficient at these CanvasRenderingContext2D things, but, it gets you rolling. Quote Link to comment Share on other sites More sharing options...
luka_friend Posted December 9, 2014 Author Share Posted December 9, 2014 Oh my God. You have no idea how much you have helped me. I was stuck with this problem. I can only say thank you, but it cannot express my gratitude enough. I have tried both of your solution (Luaacro and Wingnut) and bot of them actually worked. Unfortunately by the time I logged in back to forum, there were already both of your replays - and I can only thick one of you answers as solved. I have choosen Luaacro, because he was the first one (don't resent me Wingnut). Thank you both (both of your solution work)! Wingnut 1 Quote Link to comment Share on other sites More sharing options...
davrous Posted December 9, 2014 Share Posted December 9, 2014 Feel free to have a look to our free online course on babylon.js here: http://www.microsoftvirtualacademy.com/training-courses/introduction-to-webgl-3d-with-html5-and-babylon-js . We've covering a lot of our features. David 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.