celian-garcia Posted June 6, 2014 Share Posted June 6, 2014 Hello ! I have a plane with a DynamicTexture and I tried to do something like textureContext.fillStyle = "rgba(255, 255, 255, 0.2)";but it does'nt apply the alpha value of 0,2 .Maybe I'm too much demanding but if there is a solution it would be cool ! Here are some visual examples :textureContext.fillStyle = "rgba(255, 255, 255, 0.5)"; // or textureContext.fillStyle = "white";textureContext.fillStyle = "rgba(255, 255, 255, 0.2)"; Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 6, 2014 Share Posted June 6, 2014 Hey! I you want transparency you have to put your texture in opacitytexture channel. Diffusetexture only does alpha testing Quote Link to comment Share on other sites More sharing options...
celian-garcia Posted June 8, 2014 Author Share Posted June 8, 2014 In fact the problem is I want to have a square with alpha = 0,5 for example and the text below totally opaque...If I have both in the same textureContext and I put it in the opaciyTexture channel of the plane, it does the same like before :/Maybe I have to put square and text in separated textures ? - square in opacityTexture - text in diffuseTexture I'll try it Quote Link to comment Share on other sites More sharing options...
celian-garcia Posted June 8, 2014 Author Share Posted June 8, 2014 Oh and thank you for your answer =) Quote Link to comment Share on other sites More sharing options...
celian-garcia Posted June 10, 2014 Author Share Posted June 10, 2014 It was my bad it works great now ! I've certainly put 0,5 instead of 0.5 or another noob fail...Here is the code which works if somebody need it : var textureContext = texture.getContext();// Draws background of the pictogram on the texturetextureContext.fillStyle = "rgba(255, 255, 255, 0.5)";RANDO.Utils.roundRect(textureContext, 0, 0, picto_size.width, picto_size.height, 45);....textureContext.restore();texture.update();panel.material.opacityTexture = texture;panel.material.emissiveTexture = texture;Thank you very much =) Quote Link to comment Share on other sites More sharing options...
celian-garcia Posted June 10, 2014 Author Share Posted June 10, 2014 And result : GameMonetize and gwenael 2 Quote Link to comment Share on other sites More sharing options...
celian-garcia Posted June 11, 2014 Author Share Posted June 11, 2014 And if I want to add a pictogram.png on it ? - I tried to put the pictogram in the opacityTexture channel of material --> it appears in more transparent - I tried to put it in the diffuseTexture channel of the material --> it changes all in black ?? - I finally put it in a child panel that I offseted of 100 on Y axis. --> it works but I find it not so clean in terms of code :/ Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 11, 2014 Share Posted June 11, 2014 or you can add a plane with renderGroupId = 1 Quote Link to comment Share on other sites More sharing options...
celian-garcia Posted June 11, 2014 Author Share Posted June 11, 2014 Awesome ! there is again 2 planes but finished the **** glitches ! You made my day =DGood evening Quote Link to comment Share on other sites More sharing options...
celian-garcia Posted June 11, 2014 Author Share Posted June 11, 2014 By the way, it is renderingGroupId = 1; GameMonetize 1 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.