Page 1 of 1

Draggable component

Posted: 13 August 2015, 09:32
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...

Re: Draggable component

Posted: 13 August 2015, 11:58
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 ^^

Re: Draggable component

Posted: 13 August 2015, 19:22
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...