tingzheng Posted August 14, 2018 Share Posted August 14, 2018 Hi, i am working on a babylon project, but i am facing a problem in resizing the text according to its width https://www.babylonjs-playground.com/#XCPP9Y#598 The above playground have the features, but the problem is its need time to resize to the ideal font size, just wanted to ask is there any way to resize the font to the ideal fontsize to fit into its max width? Thanks Quote Link to comment Share on other sites More sharing options...
brianzinn Posted August 14, 2018 Share Posted August 14, 2018 I think you need to use measureText: https://www.w3schools.com/tags/canvas_measuretext.asp Easiest way to get a 2D context is from a texture. edit: add pg: https://www.babylonjs-playground.com/#XCPP9Y#600 Sebavan 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.