-
-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drag and drop support off of actors #134
Labels
feature
Label applied to new feature requests
Milestone
Comments
You can do this by enabling pointer events on actor and just using a flag on pointerdown. Should we close this? var pointerDown = false;
actor.enableCapturePointer = true;
actor.capturePointer.enableMoveEvents = true;
actor.on("pointerdown", () => { pointerDown = true; });
actor.on("pointerup", () => { pointerDown = false; });
actor.on("pointermove", (pe: ex.Input.PointerEvent) => {
if (!this.pointerDown) return;
this.x = pe.x;
this.y = pe.y;
}); |
@kamranayub Should we create an alias for the pattern you described? Something to this effect actor.draggable();
// or
actor.enableDragAndDrop(); |
jedeen
added
the
good first issue
good for people new to open source and Excalibur
label
Aug 26, 2016
pathurs
added a commit
to pathurs/Excalibur
that referenced
this issue
Feb 24, 2018
Adds several events for dragging of actors, this will allow developers to implemented their own style of 'drag and drop', such as 'pulling' or 'stretching' New Events: - Enter 'enter' - Leave 'leave' - Pointer Enter 'pointerenter' - Pointer Leave 'pointerleave' - Pointer Drag Start 'pointerdragstart' - Pointer Drag End 'pointerdragend' - Pointer Drag Move 'pointerdragmove' - Pointer Drag Enter 'pointerdragenter' - Pointer Drag Leave 'pointerdragleave' New Classes: - PointerDragEvent extends PointerEvent - GlobalCoordinates (contains Vectors for world, page, screen) New ICapturePointerConfig Property: - captureDragEvents (whether to emit drag events to the actor) Additional: - PointerEvent now contains original pointer object. - Deprecated some coordinate properties in favour of GlobalCoordinates property or a derivative. Resolves: excaliburjs#134
eonarheim
pushed a commit
that referenced
this issue
Mar 13, 2018
* Drag and drop support off of actors Adds several events for dragging of actors, this will allow developers to implemented their own style of 'drag and drop', such as 'pulling' or 'stretching' New Events: - Enter 'enter' - Leave 'leave' - Pointer Enter 'pointerenter' - Pointer Leave 'pointerleave' - Pointer Drag Start 'pointerdragstart' - Pointer Drag End 'pointerdragend' - Pointer Drag Move 'pointerdragmove' - Pointer Drag Enter 'pointerdragenter' - Pointer Drag Leave 'pointerdragleave' New Classes: - PointerDragEvent extends PointerEvent - GlobalCoordinates (contains Vectors for world, page, screen) New ICapturePointerConfig Property: - captureDragEvents (whether to emit drag events to the actor) Additional: - PointerEvent now contains original pointer object. - Deprecated some coordinate properties in favour of GlobalCoordinates property or a derivative. Resolves: #134 * Add changes to CHANGELOG.md * Using proper obsolete declarations Replace Deprecated comments with JSDOC @obsolete Use the @obsolete decorator * Use the type union PointerEventName for: _capturePointerEvents, _captureMoveEvents and _captureDragEvents
jedeen
removed
the
good first issue
good for people new to open source and Excalibur
label
Mar 31, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
The ability to drag and drop Actors would be very useful for games with mouse or touch controls.
Proposal
Implement drag and drop on Actors.
The text was updated successfully, but these errors were encountered: