no offset drag and drop Forum Home > Construct 2 General > Your Creations |
Post Reply
|
Page 12> |
| Author | |
Post Options
Quote Reply
Topic: no offset drag and dropPosted: 03 Jan 2012 at 6:45pm |
|
|
The usual method of set x,y to mouse x,y, always moves the object to its hotspot.
This method gets the offset from the hotspot, or basically gets the relative coordinate from where you clicked, and moves it there. Ie click a corner, drag that corner, not drag from the hotspot. Demo here: no offset drag and drop |
|
![]() |
|
Post Options
Quote Reply
Posted: 03 Jan 2012 at 6:52pm |
|
|
Nice :)
Thanks, newt. |
|
|
Spec:
OS: Windows 7 SP1 64bit, Intel I7-2600 3.4 GHz, Memory: 8 GB, Gfx: GeForce 560TI DirectCUII. |
|
![]() |
|
Post Options
Quote Reply
Posted: 03 Jan 2012 at 7:59pm |
|
|
Nice example. You can also do it by delta-x and delta-y rather than distance/angle, but I guess it works the same.
FWIW I was going to add an official drag+drop behavior at some point which also supports touch. |
|
![]() |
|
Post Options
Quote Reply
Posted: 03 Jan 2012 at 8:31pm |
|
|
Thanks.
Cool, planning on a major upgrade soon with touch screen monitor, so definitely looking forward to that Ashley. |
|
![]() |
|
Post Options
Quote Reply
Posted: 04 Jan 2012 at 6:35am |
|
By the way, is there an official roadmap or todo list somewhere? I can't find it. Just so we know what to expect in the not-so-distant future :) Thanks. |
|
![]() |
|
Post Options
Quote Reply
Posted: 26 Jan 2012 at 2:04pm |
|
|
Hi newt,
Could this be used for touch functions aswell? If so, how would you achieve this... |
|
![]() |
|
Post Options
Quote Reply
Posted: 26 Jan 2012 at 2:30pm |
|
|
Just add the touch object, and switch out mouse.x, mouse.y, for touch.x, touch.y, and the relative conditions.
drag and drop touch Note you will need the mouse object for preview, haven't tested on export. |
|
![]() |
|
Post Options
Quote Reply
Posted: 26 Jan 2012 at 3:06pm |
|
|
Cheers man! Ill test it!
|
|
![]() |
|
Post Options
Quote Reply
Posted: 26 Jan 2012 at 3:11pm |
|
|
It works perfect,
If I just wanted to use X positions for drag and drop how would I achieve this? At the moment it requires 4 parameters. What value do I use? Edited by 2Bdigital - 26 Jan 2012 at 3:11pm |
|
![]() |
|
Post Options
Quote Reply
Posted: 26 Jan 2012 at 3:20pm |
|
|
Not sure what you mean, Im guessing, just delete the y's.
|
|
![]() |
|
Post Reply
|
Page 12> |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |