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

Box2d label with Draw #650

Merged
merged 11 commits into from
May 10, 2022
Merged

Box2d label with Draw #650

merged 11 commits into from
May 10, 2022

Conversation

Renkai
Copy link
Collaborator

@Renkai Renkai commented May 3, 2022

Similar to #632, but extend Draw instead of using a list.
It can have a sugar

.... @ {"color": "green", "width": 10}

which list hasn't.

part of #550

@Renkai Renkai marked this pull request as draft May 3, 2022 14:24
@Renkai
Copy link
Collaborator Author

Renkai commented May 5, 2022

I want to set up the font size for text labels, but I found it complex, made it an independent issue.
#655

@Renkai Renkai marked this pull request as ready for review May 5, 2022 02:56
@Renkai Renkai requested review from eddyxu, changhiskhan and da-liii May 5, 2022 02:56
"""
# TODO add font size
return Draw(
[self, Text(text, (int(self.xmin), int(self.ymin)), color)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as I suggested in #632 , we should shift the (xmin, ymin) like (xmin, ymin-10), and 10 should be the default height (or a bit bigger) of the font size

Copy link
Contributor

@changhiskhan changhiskhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's automatically add some margin by default so the label doesn't overlap with the bounding box. other than that this looks a lot simpler. nice work.

@Renkai Renkai requested review from changhiskhan and da-liii May 7, 2022 00:06
@Renkai Renkai mentioned this pull request May 7, 2022
Copy link
Collaborator

@da-liii da-liii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@Renkai Renkai merged commit 3c7583d into main May 10, 2022
@Renkai Renkai deleted the compose_to_draw branch May 10, 2022 07:55
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

Successfully merging this pull request may close these issues.

3 participants