Draggable background: Problem selecting actors while scrolling

kanuvaskanuvas Member Posts: 21
edited May 2012 in Working with GS (Mac)
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

Best Answer

  • Barking_AppsBarking_Apps Posts: 182
    Accepted Answer
    do not know if this is relevant, but i think this is what you mean....






    BarkingApps :o3

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I don't understand what you mean by "not to be pressed." Are you referring to a rule on your actor (When Touch is Pressed)?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • kanuvaskanuvas Member Posts: 21
    thanks for your reply.

    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
  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    You can add an index game attribute called ImDraggingTheBackground and set it to 0.

    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


  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited May 2012
    Interesting you should post this... I have a similar issue with the CoverFlow demo. I want to be able to swipe (touch+hold+drag) anywhere on the screen but then tap an actor to select a level, but when I swipe on the actor, it triggers the When Touch is Pressed condition.

    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

  • kanuvaskanuvas Member Posts: 21
    Thanks very much for the responce guys. I tried the video solution and it worked perfectly.
Sign In or Register to comment.