Varsha Kamble

Updating text on dynamic texture

Recommended Posts

Hi @Deltakosh and @kcoley ,

 

I am adding text meshes in model using following link.

https://github.com/BabylonJS/Babylon.js/issues/4300

Mesh is getting added properly and it is getting saved as well.

Now my requirement is to update the text on it. As this mesh texture is getting saved dynamically, i am trying to remove previous mesh along with its texture and adding new in place.

Created a playground to replicate my issue.

http://playground.babylonjs.com/#Z3WLYL

 

Here, my problem is, Text is getting cropped if its of larger length. Also font of text gets changed based on length of added text. Tried with different length text . For smaller text font  becomes small for larger text font gets increased.

I want the font of text to be consistent, no matter what is length of text. Also the plane should get dynamic width based on length of text. No text should get cropped.

Please help me in this.

Thanks.

 

Regards,

Varsha

 

Share this post


Link to post
Share on other sites

@Varsha Kamble

Your math is incorrect. The font that you use is not able to fit in the math you set for the length of your plane and dynamic texture. If you still have issues, then I can easily build a PG scene which accommodates any text. But I hope you can identify your errors in expecting the font to fit within the mesh.

DB

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.