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

Add setDisplaySize method in BitmapText #6623

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rexrainbow
Copy link
Contributor

Please do not update the README or Change Log, we will do this when we merge your PR.

This PR (delete as applicable)

  • Adds a new feature

Describe the changes below:

Since BitmapText does not have original size, I set scaleX, scaleY to 1 to get original size,
then calculate new scaleX, scaleY by displayWidth, displayHeight.

@photonstorm
Copy link
Collaborator

Does it fix something to add this? Or is it just a feature?

@rexrainbow
Copy link
Contributor Author

rexrainbow commented Sep 28, 2023

Since displayWidth, displayHeight properties does not have setter, I thought it is a new feature.

Because that BitmapText has scaleX, scaleY properties, it can have setter of displayWidth, displayHeight propertie.
But BitmapText does not store original size (size when scale is 1) directly, I have to get this original size first. This solution is not straightforward I agree.

@photonstorm
Copy link
Collaborator

I think I'd rather just store the original size somewhere and use that. Although I guess it will need resetting every time you change the font size, for example.

@rexrainbow
Copy link
Contributor Author

I think I'd rather just store the original size somewhere and use that. Although I guess it will need resetting every time you change the font size, for example.

It is a better solution.

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