Dragging actor
Dooki
Member Posts: 247
Hey all,
Well I'm trying to create a actor I can drag. Looking at Joe's tutorial this is what I have and it's not working. What am I missing? Thanks!
First I created attribute (boolean) "dragging."
Rule: Dragging
All when mouse is down
----Rule
------All when mouse is down
------Attribute: self.dragging is false
----Change attribute
------self.dragging To:true
Rule
All when mouse is down
Attribute: self.dragging is true
----Change attribute
------self.dragging To false.
Nothing happens. I cannot drag or move my actor.
Thanks,
Dooki
Well I'm trying to create a actor I can drag. Looking at Joe's tutorial this is what I have and it's not working. What am I missing? Thanks!
First I created attribute (boolean) "dragging."
Rule: Dragging
All when mouse is down
----Rule
------All when mouse is down
------Attribute: self.dragging is false
----Change attribute
------self.dragging To:true
Rule
All when mouse is down
Attribute: self.dragging is true
----Change attribute
------self.dragging To false.
Nothing happens. I cannot drag or move my actor.
Thanks,
Dooki
Comments
Create an attribute (boolean) called dragging.
Then two Rules, like this:
Rule
When Touch is Pressed
-----Change Attribute: self.dragging To: true
OTHERWISE
-----Change Attribute: self.dragging To: false
Rule
When self.dragging = true
-----Constrain Attribute: self.Position.X To: Mouse.Position.X
-----Constrain Attribute: self.Position.Y To: Mouse.Position.Y
-Dooki
Thanks ^-^;
So again, will this work with the touch settings? I cannot reproduce the dragging with touch settings (preview).. but will it work on iDevices?
Thanks
However, Mouse will only act as one Touch on a device - not multitouch.
Which can be handy if you don't want to allow multitouch in a certain situation.
I've ran into the following problem:
I'd like to be able to touch drag a rectangle, but what happens is that it centers the actor where I have clicked (touched). Is this only happening in the gamesalad preview or on the iphone too? (bad thing I cannot test right now on an iphone)
What I need is a touchable drag&drop surface that is not jumping to the center!
Thank you,
Glenn