Jump to content

Transparency color


luka_friend
 Share

Recommended Posts

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): 

 

post-11698-0-63514000-1418066301.png

 

Link to comment
Share on other sites

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.alpha

Otherwise, can you reproduce your problem in the playground if these parameters don't work ?

 

Thanks

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)! 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...