-
Notifications
You must be signed in to change notification settings - Fork 826
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
Add word wrapping option for Text Object #658
Conversation
Looks good for the code! Great job 👍 Technically, this could be implemented with Could be useful I think and seems feasible - what do you think? |
I had the same idea, you know?, but then realized that custom size is not passed to the text object, and I was fearing to mix non-related things. But if you think it's ok I could do it, and then just remove the "Wrapping width" option from the editor, it looks ugly. Also, I was thinking on adding a small graphic line in the instance renderer to show the wrapping width, but right now you're using a single PIXI objet to render each instance. Using the custom width would be cool here too, because the text wrapping width would be displayed in the editor through the collision mask (we have to store the custom size in the text object json too, I think it isn't saved right now). |
I think we can remove it in this case, if we're considering that wrapping will be set by the instance width :) (or by using events).
If needed you can change the object to be a PIXI.Container, which can contain multiple PIXI objects inside.
Yes that's the good part! :)
What do you mean? |
Oh, I don't know why I thought the custom size was not serialized nor passed to the instances if it was a text object, that's why I not implemented it in the first place :P I'm on it |
Wait, @4ian, if we use the custom size and custom width as wrapping in the editor, and convert this data to wrapping in the runtime object, we could just remove the wrapping properties set in TextObject.h/cpp files and don't serialize it at all... |
That's true! GDevelop.js pull request is then not useful. That will keep things simple! |
Ok, it should use the custom size now, I've updated the text instance renderer on the IDE so the position is updated after changing the object size. |
Sorry about this I know it's frustrating to spend time like this when it's to remove the code then :/ |
Don't worry man, just kidding, supper happy to make it to work actually :D |
Merging this now as it looks good! Thanks for working on this 👍 |
Thank you @Lizard-13 awesome feature :D 👍 |
Great work! What next.... Skeleton? 🤔 |
skeleton in gd5 would be amazing! :D |
Mmmmh, now I can compile libGD.js, so why not?, not sure how much time it will take but skeleton is next :) |
@Lizard-13 this is literally the most exciting feature for me to have in gd5. |
It's just a graphical feature, you can't get the number of wrapped lines.