You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Can you tell me how to access the eventlisteners of the swing library?
I want to do something like this.
// Add event listener for when a card is thrown out of the stack.
stack.on('throwout', (event) => {
// e.target Reference to the element that has been thrown out of the stack.
// e.throwDirection Direction in which the element has been thrown (Card.DIRECTION_LEFT, Card.DIRECTION_RIGHT).
console.log('Card has been thrown out of the stack.');
console.log('Throw direction: ' + (event.throwDirection == Card.DIRECTION_LEFT ? 'left' : 'right'));
});
// Add event listener for when a card is thrown in the stack, including the spring back into place effect.
stack.on('throwin', () => {
console.log('Card has snapped back to the stack.');
});
The text was updated successfully, but these errors were encountered:
You should be able to get 'stack' from SwingStackComponent. Most likely you will use ViewChild or ViewChildren to get access to the SwingStackComponent and then get 'stack' property. I will update the example to show it shortly
Hi,
Can you tell me how to access the eventlisteners of the swing library?
I want to do something like this.
The text was updated successfully, but these errors were encountered: