Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I get the display width of text #449

Open
dladeira opened this issue Oct 18, 2024 · 1 comment
Open

How do I get the display width of text #449

dladeira opened this issue Oct 18, 2024 · 1 comment

Comments

@dladeira
Copy link

Hey, I'm creating a text component like this

const portText = new FFText({
    text: `Bedrock port: ${server.port}`,
    fontSize: 72,
    color: "#ffffff",
    duration: finalDuration - outroDuration,
});
portText.setFont(`./public/fonts/${body.font}`);
portText.addEffect("fadeIn", 0.01, finalDuration - outroDuration);
portText.addEffect("fadeOut", 0.01, finalDuration);
scene.addChild(portText);

And I'm trying to get it's display width by serverLogo.getWH()[0], although this is returning null. Is there a way I can know how wide it is going to be? Thanks in advance

@drawcall
Copy link
Member

drawcall commented Nov 4, 2024

Oh, maybe there is no good way to get it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants