imosek8 Posted January 4, 2017 Share Posted January 4, 2017 Hello everybody! I am trying to make text plane fade animation with text drawn on texture. I created dynamic texture, then created a plane. Next I set texture as textPlane.material.diffuseTexture. Texture has hasAlpha set to true. this.textPlaneTexture.drawText(text, null, 50, 'bold 100px Roboto Mono', 'pink', 'transparent'); So there's text written on the screen with transparent background. Next I created fade animation like: var fading = new BABYLON.Animation.CreateAndStartAnimation('fade' + this.text, this.textPlane.material, 'alpha', 30, 30, 1, 0, 0, null, () => { this.textPlane.isVisible = false; }); But here's the problem when the alpha is changing then also backgorund is getting from black to transparent. Why is that? How to prevent changing background alpha, only the text is alpha change is expected. Here's the playground http://playground.babylonjs.com/#28LOAX Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 5, 2017 Share Posted January 5, 2017 Hello! something like that: http://playground.babylonjs.com/#28LOAX#1 ? Wingnut and imosek8 2 Quote Link to comment Share on other sites More sharing options...
imosek8 Posted January 5, 2017 Author Share Posted January 5, 2017 Thank you very much! It's what I need! Quote Link to comment Share on other sites More sharing options...
imosek8 Posted January 5, 2017 Author Share Posted January 5, 2017 @Deltakosh I've noticed that now the color of drawn text is always white...So should I only change emissive color? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 5, 2017 Share Posted January 5, 2017 Correct 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.