Dragging objects and collision polygon [SOLVED]

Just started using Construct 2? Post your questions here

Post » Thu Sep 01, 2016 7:01 am

Hi

I am sure I have found this before here and have searched here and on the net to no avail. So first of all, I apologise if I have missed something obvious.

Understanding that the drag and drop behaviour only works with the collision polygon, I had to make my sprite into two different parts and pin these two together. All good so far, however on pinning the objects I can only drag one of the two parts around even though I have applied the drag and drop behaviour to both objects and when I use the other part , I am dragging it from its collision polygon.

Is there something else that needs to be done to allow both parts to drag ? Eventually this sprite might be made up of three or more parts so I want to make sure that it can be dragged from anywhere

Thanks

TimCS
Last edited by timcs on Fri Sep 09, 2016 9:31 pm, edited 1 time in total.
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Thu Sep 01, 2016 7:14 am

if you're trying to drag the pinned object, it will have trouble dragging, because it is also trying to stay pinned to the other object. if the objects are overlapping, you can just turn the drag/drop off on the pinned object. if they are not overlapping, you could maybe have the drag/drop and pin switch enabled/disabled depending on which sprite is dragged.. although, there's probably a better way than that, that isn't coming to me right now.
B
88
S
43
G
71
Posts: 601
Reputation: 43,669

Post » Thu Sep 01, 2016 7:27 am

spacedoubt wrote:if you're trying to drag the pinned object, it will have trouble dragging, because it is also trying to stay pinned to the other object. if the objects are overlapping, you can just turn the drag/drop off on the pinned object. if they are not overlapping, you could maybe have the drag/drop and pin switch enabled/disabled depending on which sprite is dragged.. although, there's probably a better way than that, that isn't coming to me right now.


@spacedoubt

Thanks for you quick response, I will look into this , I would like to be able to drag from either objects , they may be overlapping just though . The only thing is one of the objects coliision polygon is not and intentionally covering its entire body that is why I wanted to pin them this way.

Is there another form of plugin/behaviour that gets around this ?

Thanks

TimCS
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Thu Sep 01, 2016 7:33 am

I'm not the guy to ask about 3rd party plugins.. If something seems even vaguely possible without them, I won't use them. Yeah.. I'm one of those guys :roll: ... You'd be surprised how unnecessary most of them really are.

There probably is though.. but I don't know.

Best I can figure, whichever one is dragging, shouldn't be pinned. and whichever one isn't dragging, should be. so if you can find a way to switch between the two, it should work.
B
88
S
43
G
71
Posts: 601
Reputation: 43,669

Post » Thu Sep 01, 2016 12:22 pm

spacedoubt wrote:I'm not the guy to ask about 3rd party plugins.. If something seems even vaguely possible without them, I won't use them. Yeah.. I'm one of those guys :roll: ... You'd be surprised how unnecessary most of them really are.

There probably is though.. but I don't know.

Best I can figure, whichever one is dragging, shouldn't be pinned. and whichever one isn't dragging, should be. so if you can find a way to switch between the two, it should work.


@Spacedoubt

I think I get what you are saying , so when dragging , reverse the pinned logic and vice versa ?
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Thu Sep 01, 2016 8:38 pm

@SpaceDoubt

That works thanks so when object A starts to be dragged and is pinned to object B. I unpin object A from B and then pin B to A and vice versa depending on which object part is being dragged
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests