Draggable component

Game development with Board Game Arena Studio
Post Reply
User avatar
apollo1001
Posts: 191
Joined: 21 July 2015, 10:41

Draggable component

Post by apollo1001 »

Hi All

I was wondering about using the 'Draggable' component in my project but there appears to be no documentation (or old forum posts) for it. Has anyone used it before and/or know anything about its options?

Also happy to hunt through a game's code if anyone can think of a game that already uses it...

Thanks, A.


EDIT: I have just noticed the "Drag'n'Drop should be avoided" part of the Studio Guidelines so, whilst I'm still interested if anyone has any information, I will need to code up a click-click option anyway...
User avatar
pikiou
Posts: 389
Joined: 03 October 2011, 05:36

Re: Draggable component

Post by pikiou »

Drag and drop is used in Hanabi.
But yeah it's good practice to only have it as a bonus way of interacting.

Here is some documentation about the component:

Code: Select all

// Note: surface_item_id specify the item to be clicked to start the dragging. If null, same item than item_id
create: function( page, item_id, surface_item_id )
disable: function( cursorType )
enable: function( )

// Hook functions for controls clients
onStartDragging: function( item_id, left, top )
onEndDragging: function( item_id, left, top )
onDragging: function( item_id, left, top )
Is it enough? Feel free to add it to the wiki if it is ^^
User avatar
apollo1001
Posts: 191
Joined: 21 July 2015, 10:41

Re: Draggable component

Post by apollo1001 »

Thank you! I'll code it up normally, and then play with this to see if a draggable alternative might be able to speed up play. Will let you know how it goes when I get there...
Post Reply

Return to “Developers”