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

Đang mở
#7,388 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript
Lĩnh vực
game-dev

Hướng nghiên cứu

Start in Transform.js at Container.getWorldTransformMatrix and the getWorldPoint/getLocalPoint entry points, then inspect the TransformMatrix instance and its applyITRS method. Reproduce the calls from the issue in Phaser 4.2.1; done means both methods work without the reported TypeError, including the documented container and sprite setup.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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: https://github.com/FreezingMoon/AncientBeast/commit/516f4b41

Ngôn ngữ chính
JavaScript
Star
40.7k
Fork
7.2k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của phaserjs/phaser

Tất cả issue của phaserjs/phaser

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.