TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
Resolved Questions
→
Drag and drop behaviors problem
Pages:
1
2
3
Drag and drop behaviors problem
flameblue59
Posts: 113
December 18, 2014, 08:15:17 am
Hi, I'm using drag and drop behaviors but when I more than one object combined into one point and I do clicking on it. Those object are selected. How if I want to select one object only and let the other object there.
yoplalala
Posts: 1632
December 18, 2014, 08:26:11 am
To select only one, click on shift. To copy use alt.
flameblue59
Posts: 113
December 18, 2014, 08:47:33 am
I mean that drag and drop behavior, for example two objects placed have same size placed on same x & y coordinate. Let's say red & blue box. How can I click the red box then drag to another place within dragging the blue box. Using drag and drop behavior will drop everything which touching by our cursor.
yoplalala
Posts: 1632
December 18, 2014, 08:52:20 am
you have to type shift at the same time you're clicking
letmethink
Posts: 2545
December 18, 2014, 09:00:21 am
Quote from: yoplalala on December 18, 2014, 08:52:20 am
you have to type shift at the same time you're clicking
He isn't talking about the editor. He is talking about a game he is making.
~Letmethink
flameblue59
Posts: 113
December 18, 2014, 09:06:16 am
@yoplala
I'm not talking about editor but the game which I made. I wish you could help me.
@letmethink
sure, I'm thinking about the default behavior of stencyl, do you know how choose for one actor, so the other actor won't be dragged when they're on the same point.
yoplalala
Posts: 1632
December 18, 2014, 09:16:59 am
Oh.... my bad .....
Humm good question. You'll have to set a priority. The littler the object the higher the priority I think would be be good.
But now how would you set it ?
I'll see the drag behaviour and come back if I have an idea
yoplalala
Posts: 1632
December 18, 2014, 09:25:30 am
Okay I have one, I 'm ginng to test it and post the modified code if it works
yoplalala
Posts: 1632
December 18, 2014, 10:03:10 am
My method didn't work. I'll try to think about this later, if nobody answers. I have to go now
flameblue59
Posts: 113
December 18, 2014, 06:56:44 pm
thanks a lot for your help yoplalala, anyone can help me how to get out from this problem?.
LIBERADO
Posts: 2720
December 18, 2014, 08:56:27 pm
I think somewhere on my folders I have a behavior that I created some time ago to get what you want.
And I remember that it worked well.
The actors that you want to drag and drop, are they all the same actor type? Are they all in the same layer?
« Last Edit: December 18, 2014, 09:46:20 pm by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.
flameblue59
Posts: 113
December 19, 2014, 12:00:19 am
They're on different actor and different layer. I want to make dress up game but when two or more objects combined in one position then I want to drag one of them. However, all of them are dragged.
yoplalala
Posts: 1632
December 19, 2014, 03:30:08 am
Now thtat I look at my code, I did the stupidest mistake. But now it works.
So here is it :
I juste added a game attribute list.
When you click on a object it adds his width to the list.
We always remove from the list all the biggest number.
We can only move the object, if it has his width in the list.
Now you could change it. Not use the width but some other thing.
or used the width and the actor id if ever ther's two objects the same width ...
Hope it helps.
flameblue59
Posts: 113
December 19, 2014, 08:08:50 am
I can't understand how to build it. How to do by editing the behavior drag and drop?. Should I do custom like it?.
letmethink
Posts: 2545
December 19, 2014, 08:14:13 am
Create a new behaviour. Add the events and blocks (the ones you can't find by searching are normally attributes that you must add yourself). Test.
~Letmethink
Pages:
1
2
3