Misleading documentation for drop zone events
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 40.3k
- Forks
- 7.2k
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the linked Phaser input documentation's drop-zone section and review the examples using gameObject.setInteractive and the drop event. Rename the example variable or otherwise distinguish the drop zone from the dragged object, and state which object receives drop-zone events; the documentation should remove the ambiguity described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100