Highlight when Pressed

BluSpyderBluSpyder Member Posts: 129
edited November -1 in Working with GS (Mac)
You know in some apps when you click on an item and it will be highlighted till you release? I want to do that in my menu. If you touch it, the text(image) will have a glow around it.

So I've created two images, one with my non-highlighted, and one with my highlighted. I set the image so that when it is pressed, it changes the image to my highlighted one.

BUT HERE IS THE ISSUE. When you release on the image it will go to the scene i have chosen, good. But say the person touches the image (changing it to the highlighted) but then MOVES OFF the image while still touching, and releases elsewhere off the image. Now my image still remains highlighted and theres no scene change.

How can I make it so if the highlighted image is released elsewhere on the screen, it will switch back to not highlighted image?

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    make a rule in the actor recieves event mouse position is outside, then have change image back to the one withoutthe highlight
  • BluSpyderBluSpyder Member Posts: 129
    Sorry, this is for an iphone app. Tried setting touch release + touch outside and that didnt work. Not sure the mouse position would work in the iphone would it?
  • ScootsScoots Member Posts: 507
    Check out FireMapleGames Keyboard demo, he highlights keys,
    look at his rules

    http://gamesalad.com/game/1918
  • osucowboy18osucowboy18 Member Posts: 1,307
    Wingnology said:
    Sorry, this is for an iphone app. Tried setting touch release + touch outside and that didnt work. Not sure the mouse position would work in the iphone would it?

    I believe mouse and touch are the same thing in an iPhone app, so John's rule should work. However, Joe's keyboard demo would also be a great way to find out for sure.

    - Alex
  • MotherHooseMotherHoose Member Posts: 2,456
    Listen to John! if he says mouse position ... the mouse position events will work...

    also could have this coding...
    Rule (All) when
    Actor receives event Touch is pressed
    Actor receives event Touch is inside
    --ChangeImage
    --Timer after 0.1 seconds changeScene
    Otherwise
    changeImage to the original

    MH
  • CaniohCanioh Member Posts: 200
    Yup, mouse and touch is pretty much the same will work both on a Mac and on IOS
  • BluSpyderBluSpyder Member Posts: 129
    Thanks a ton guys, its working.
Sign In or Register to comment.