Draggable background: Problem selecting actors while scrolling
Hi All,
I have been using the Background Drag Scrolling Example on the game salad examples page. This allows me to drag around a big background. It also works well.
My Issue is when I put an actor onto the background I need the actor not to be pressed when I am dragging. I have tried many different ways of trying to achieve this but everything seems to fail. I was wondering if anyone had a moment to help me out with this?
Cheers
Simon
I have been using the Background Drag Scrolling Example on the game salad examples page. This allows me to drag around a big background. It also works well.
My Issue is when I put an actor onto the background I need the actor not to be pressed when I am dragging. I have tried many different ways of trying to achieve this but everything seems to fail. I was wondering if anyone had a moment to help me out with this?
Cheers
Simon
Best Answer
-
Barking_Apps Posts: 182
Answers
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
So when I use the mentioned example, I create another actor and place it on the screen (map). When I scroll around the screen and I click on that actor I want the map to continue scrolling which it does. However the actor I placed has an on Press rule which I don't want to activate when I am scrolling.
Cheers
On the background add this to the dragging rule:
--Change attribute ImDraggingTheBackground to 1
And this on the otherwise of the dragging rule:
--Change attribute ImDraggingTheBackground to 0
That way you can then add a rule on your other actors on screen that says:
When touch is pressed AND ImDraggingTheBackground is 0
--Do what they need to do
The only thing I can think of is to keep track of how long the actor has been held down and make the Touch is Pressed only activate for short taps rather than long holds. Not a perfect solution by any means.
Actually, that video has the solution... thanks!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User