Misleading documentation for drop zone events

オープン
#7,146 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
48/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
javascript
領域
documentation

調査の方向性

リンク先の Phaser input ドキュメントのドロップゾーンのセクションから始め、gameObject.setInteractive と drop event を使用している例を確認してください。例の変数名を変更するか、別の方法でドロップゾーンとドラッグされるオブジェクトを区別し、どのオブジェクトがドロップゾーンのイベントを受け取るのかを明記してください。ドキュメントでは、issue で説明されている曖昧さをなくす必要があります。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
JavaScript
スター
40.7k
フォーク
7.2k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

phaserjs/phaser のほかの issue

phaserjs/phaser の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。