Sign in to follow this  
royibernthal

GUI - TextBlock Size fit parent

Recommended Posts

It is possible somehow.

But I think that you should change the textBlock.text not the textBlock.

And width and height is probably the canvas size.

And I am unsure that % must be written in apostrophees.

 

Share this post


Link to post
Share on other sites

Width and height by default I think are 1, which means '100%'. If you write it like that then apostrophees are required, otherwise you can write a number between 0-1 which will be interpreted as %.

The thing is the dimensions in percentage don't affect the text size, neither does scale.

By changing textBlock.text do you mean changing the font size?

Share this post


Link to post
Share on other sites
3 hours ago, royibernthal said:

Width and height by default I think are 1, which means '100%'. If you write it like that then apostrophees are required, otherwise you can write a number between 0-1 which will be interpreted as %.

The thing is the dimensions in percentage don't affect the text size, neither does scale.

By changing textBlock.text do you mean changing the font size?

Ok the percentage is correct...

I am not using GUI a lot so I may be wrong.

Share this post


Link to post
Share on other sites
6 hours ago, royibernthal said:

I'm not really sure what you're suggesting to be honest :)

To make the text fit the plane.

Like the text is equivalent to 100% of the plane.

But, the text there is tiny.

Share this post


Link to post
Share on other sites
10 minutes ago, royibernthal said:

Well, that's what I'm trying to do, that's the issue.

Lol I thought you were asking what is the question about and I didn't read the username.

Share this post


Link to post
Share on other sites
5 hours ago, royibernthal said:

Right I forgot :)

I don't have a problem with manually selecting the right font size, but is a huge font size the best option? Won't it hurt performance? At the moment locally I'm using fontSize 500.

http://www.babylonjs-playground.com/#ZI9AK7#18

It won't hurt the performance.

And following statistics I can say it is ok to put big text.

Before: 60 fps

After: 60 fps

No Change

Share this post


Link to post
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.