Mouse position is over. Question

CodeMonsterCodeMonster ACT, AustraliaMember Posts: 1,078
Just a quick question. If I use this rule. Would it work for as touch being pressed or dragged on the screen?
Caus I have a left and right button and I don't want the person to have to lift there finger and place down again to move left and right. So would this work for the iPhone?

Rule: for left button
When
Mouse position is over actor
Do>
Move left

Rule for right button:
When
Mouse position is over actor
Do>
Move right.

So you can slide your finger to the left button and back to the right so u can move left and right like that.
Would this work as a finger?
Sorry if I'm confusing
Thanks in advance!

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    The first question I have for you is... did you try it and did it work?

    The second question is... what is "mouse position is over actor"? Do you mean 'Actor receives event mouse position is inside'? Or do you mean 'Actor receives event touch is inside'? Or maybe something else?

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

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

  • CodeMonsterCodeMonster ACT, AustraliaMember Posts: 1,078
    Well it works in preview But would it work on device?
    And no it's a rule:
    When mouse position is over actor


    And when I hover the mouse button over the actor, the rule will work.

    But since there isn't a mouse when playing on the iPhone. Would a finger be used to hove on the button?
    @tatiang
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited January 2014


    But since there isn't a mouse when playing on the iPhone. Would a finger be used to hove on the button?
    @tatiang
    Hi @CodeMonster Well, you could hover your finger above your iPhone but it won't do anything.... so although "When mouse is down" is equivalent to "when touch is pressed" on a device, "When mouse is over" has no equivalent for devices, simply because you have to touch screens to make them work.....

    So stick with when mouse (touch) is inside perhaps, which could be considered the closest to when mouse is over.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • CodeMonsterCodeMonster ACT, AustraliaMember Posts: 1,078
    Shame. I'll have to find another way mmm
    Thanks though!
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited January 2014
    Yes the I device screen is a capacitor sensor that registers contact on the screen. For anything to be registered there needs to be contact with the screen, period.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @CodeMonster are you not able to test on an actual device? I ran the demo I posted on an iPhone 5 and it worked as expected. You don't have to lift your finger at all.

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    And no it's a rule:
    When mouse position is over actor
    Weird. I guess I've never seen that. :-?

    image

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

  • CodeMonsterCodeMonster ACT, AustraliaMember Posts: 1,078
    Odd. Must be windows only for that rule
    And thanks heaps I'll look at the demo again.
    And yeh I can't test at the moment as I don't have access to my mac for another week.

    An yeh thanks @tatiang
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited January 2014
    The rules in my demo are just:

    Left arrow button
    When touch is inside
         Change attribute game.direction (integer) to -1
    Otherwise
         Change attribute game.direction to 0

    Right arrow button
    When touch is inside
         Change attribute game.direction (integer) to 1
    Otherwise
         Change attribute game.direction to 0

    Moving actor
    When attribute game.direction = -1
         [move to the left]
    When attribute game.direction = 1
         [move to the right]


    *You can set the values to anything you like... they don't need to be 0, -1, and 1, but that's usually what I use.

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

  • CodeMonsterCodeMonster ACT, AustraliaMember Posts: 1,078
    Ah. Iv been using when touch is pressed and touch is inside.

    My mistake...
    Thanks @tatiang
Sign In or Register to comment.