Skip to content

Bug: Bitmap font not taking account texture rotation #11086

@raejuli

Description

@raejuli

Current Behavior

When creating a Bitmap font with textures that have rotation due to texture packing, the corresponding bitmap character image will be rotated also.

Expected Behavior

Texture rotation is accounted for and the resulting bitmap character will be correctly, orientated.

Steps to Reproduce

Have rotated texture that will be used in a bitmap font. Set that rotated texture block as a character's texture. Instantiate the bitmap font. Create a bitmap text and add to scene tree to be rendered. See that the bitmap character will be rotated instead of correctly orientated.

Environment

  • pixi.js version: 8.5.2
  • OS & Version: Windows 11

Possible Solution

In the BitmapFont line 47 should also extract the rotate property from the incoming texture:

const {
    frame: textureFrame,
    source: textureSource,
    rotate: textureRotate
} = textures[charData.page];

and further below on line 59, should become:

const texture = new Texture({
    source: textureSource,
    frame: frameReal,
    rotate: textureRotate
});

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    $25Small bug or feature bounty. Something that might take up to an hour to address.priority: normalImportant but not blocking the next releasescope: text-bitmapIssue related to BitmapText rendering💰BountyBounty of any size📢 Accepting PRsWould welcome a PR from the community.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions