TheShookOne Posted October 8, 2017 Share Posted October 8, 2017 Hi all I was wondering if Pixi has a method for creating the appropriate sized text when within a scaled container. In my case, I scale the main container so that its height is 1080. In this container, I would create a Pixi.Text object with height 20px. From what I understand, this creates a 20px text object, which is then scaled down when placed in the container. This results in text which is slightly blurry. I'm planning on creating a method which would calculate the true pixel height required, which would then be scaled to the size needed. Is this something which Pixi itself supports, or would I need to build this myself? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted October 8, 2017 Share Posted October 8, 2017 PIXI doesnt have mechanisms for that, you have to choose font size and scale manually. The algorithm isn't that difficult, you have to search this forum (page 1-page2) and https://github.com/pixijs/pixi.js/issues , there were many threads like that. Quote Link to comment Share on other sites More sharing options...
TheShookOne Posted October 8, 2017 Author Share Posted October 8, 2017 Yeah it shouldn't be something difficult to do. I did search through the js file to see if Pixi can already do this, but it doesn't seem to be the case. Wanted to make sure I wasn't missing anything. I did do a search for text scaling, but it seemed to be people wondering about linear or bicubic scaling. Couldn't find questions about building text in the perfect resolution in the first place. 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.