Misleading documentation for drop zone events

Đang mở
#7,146 0 bình luận 1 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ó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
48/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu từ phần drop-zone trong tài liệu input Phaser được liên kết và xem lại các ví dụ sử dụng gameObject.setInteractive và drop event. Đổi tên biến trong ví dụ hoặc bằng cách khác phân biệt drop zone với đối tượng được kéo, đồng thời nêu rõ đối tượng nào nhận các sự kiện của drop zone; tài liệu cần loại bỏ sự mơ hồ được mô tả trong issue.

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

Mô tả

Version

  • Phaser Version: 3.88.2

Description

The documentation explains drop zone concept and provides examples like so:

gameObject.setInteractive({ dropZone: true });

So we instinctively think that gameObject is a drop zone. In next paragraphs the following code can be found:

gameObject.on(
  "drop",
  function (pointer, target) {
    /* ... */
  },
  scope
);

Which suggests that drop event is triggered on the zone itself. However after 1hr of experimentation I found out that it is not exactly right. The drop event is not triggered on the zone, but rather on the object that is being dragged. It would be great to rename the gameObject to something more meaningful in the documentation and provide an explicit comment on which game object the drop and other dropZone events are triggered. That way some time on debugging and experimenting can be saved for the developers. I'd propose a change in documentation via a PR but could not find the repo containing the docs.

Link: https://docs.phaser.io/phaser/concepts/input#drop-zone:~:text=gameObject.on(%0A%20%20%22drop%22%2C%0A%20%20function%20(pointer%2C%20target)%20%7B%0A%20%20%20%20/*%20...%20*/%0A%20%20%7D%2C%0A%20%20scope%0A)%3B

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.