Jump to content

Plane with texture and drawText fade animation


imosek8
 Share

Recommended Posts

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

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