Skip to content

Container.getWorldPoint() / getLocalPoint() throw "tempMatrix.applyITRS is not a function" in 4.2.1 #7388

Description

@DreadKnight

Description:

Phaser 4.2.1: Calling container.getWorldPoint(x, y) or container.getLocalPoint(x, y) throws:
TypeError: tempMatrix.applyITRS is not a function at Container.getWorldTransformMatrix (Transform.js:517) at Container.getWorldPoint (Transform.js:627) at Container.getLocalPoint (Transform.js:584)

Root cause: getWorldTransformMatrix() creates new TransformMatrix() but the instance lacks applyITRS at runtime (method exists in source but not on constructed object).

Minimal reproduction:

const container = scene.add.container(100, 100);
const sprite = scene.add.sprite(50, 50, 'key');
container.add(sprite);
container.getWorldPoint(0, 0);  // throws
// or
container.getLocalPoint(200, 200);  // throws

Environment: Phaser 4.2.1, WebGL renderer, TypeScript project, OS: Kubuntu

Workaround: Manual transform walking up parentContainer chain
See getWorldPointManual/getLocalPointManual in this commit: FreezingMoon/AncientBeast@516f4b41

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions