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
Feature-Request: V8 support sub-Textures when creating BitmapFont objects #10482
Comments
Yeah, that's right, the There seems to be a simple solution: pixijs/src/scene/text-bitmap/BitmapFont.ts Lines 46 to 59 in ff67a1d
We could simply offset Rectangle's x and y values by the Texture's frame. I think that would probably be enough! |
Thank you for the response! I forgot to mention that the same case worked in version 7.x (7.3.2 at least), that's why I thought it's a regression. pixijs/packages/text-bitmap/src/BitmapFont.ts Lines 224 to 229 in 9104ebd
Any way, I can confirm this solution works for my case 🙇♂️ |
Nice. Would you mind making a PR for this change @alvov-evo? |
@bigtimebuddy done |
Current Behavior
BitmapFont doesn't seem to use texture with defined frame but rather a source texture of that framed texture.
Expected Behavior
BitmapFont uses texture with defined frame.
Steps to Reproduce
Let there be multiple bitmap font textures combined into one sprite sheet file.
Create BitmapFont with a constructor as follows:
Then create BitmapText using font family of this font:
In that case BitmapFont doesn't seem to use
fontTexture
as source, but would rather use the whole sprite texture.For instance, I've created a sprite sheet image with two Desyrel fonts: yellow on the left and green on the right.
Please check the playground: https://www.pixiplayground.com/#/edit/T5-gUiUddcNFhan8QaTPD
I pass the texture referring to the "green" texture to BitmapFont (so rendered text should be green), but it still seems to use the source sprite sheet texture (rendered text is yellow).
(Sorry for the somewhat messy playground example)
Environment
pixi.js
version: 8.1.0Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: