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

Newlines don't work with Canvas rendering #1213

Open
nightblade9 opened this issue Nov 21, 2020 · 5 comments
Open

Newlines don't work with Canvas rendering #1213

nightblade9 opened this issue Nov 21, 2020 · 5 comments

Comments

@nightblade9
Copy link

nightblade9 commented Nov 21, 2020

Just want to point out that the code below works if your component has DOM, but not Canvas (and obviously not WebGL, which doesn't seem to support text yet):

Crafty.e("Text").text("hi\nthere")

Renders in Canvas as hi there and in DOM as:

hi
there

Tested with v0.9.0.

@Nep-Toodles
Copy link

ok hmmmm i dont think who created this framework is alive rn

@nekromoff

This comment has been minimized.

@nightblade9
Copy link
Author

@nekromoff please don't hijack my thread to talk about whether CraftyJS is dead or not. The last commit was in 2018.

@nekromoff

This comment has been minimized.

@andrejmoltok
Copy link

Well, as far as I know \n in JS language always puts text in new line, so just try putting a simple space between.

Just guessing.

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

4 participants