GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Changing Overlapping Images from On To Another

MarcusOMarcusO Posts: 147Member
I have a pause and play actor with their corresponding images.

I put both of these actors on top of the other.

The idea is to be able to change from one actor to the other actor and show there corresponding images.

So if i was to press the Pause actor image. the "Change Image" behaviour would bring out the Play actor
and when i press the Play actor image. the "Change Image" behaviour would bring out the Pause actor

However, I am only able to move from the Pause button to the Play button. When i go to click on the Play actor, the Pause actor doesn't come back up?

Any ideas???

Comments

  • scribblstudiosscribblstudios Posts: 118Member
    I would just use one actor and have this, when touch is pressed,"change attribute game paused to -game paused"
    (game paused would start at 1)

    If game paused=1 change image to pause
    If game paused=-1 change image to play

    Hope this helps!:)
  • tenrdrmertenrdrmer Posts: 9,934Member, Sous Chef, Senior Sous-Chef
    scribblstudios said:
    I would just use one actor and have this, when touch is pressed,"change attribute game paused to -game paused"
    (game paused would start at 1)

    If game paused=1 change image to pause
    If game paused=-1 change image to play

    Hope this helps!:)

    On the right track but what you actually want to do is these to rules

    When touch is pressed
    --Change attribute Game.pause to (Game.pause+1)%2

    When Attribute game.pause = 1
    --Change image to pause
    Otherwise
    --Change image to play

    That ouch is pressed rule will cycle back and forth between 1 and 0 each time it is pressed. so it will start at 0 and when its paused it will be 1 and then when you touch it to unpause it will be 0 again. Although you know if you are actually using the pause behavior you will need this actor placed in both you pause scene as well as your game scene because you will not be able to touch the pause button in the scene when the pause behavior is active.

    It's not my fault I never learned to take responsibility for anything. ;)

  • MarcusOMarcusO Posts: 147Member
    Both suggestions are very helpful. The changing of images back and forth between the two works.

    Thanks Guys.
  • MarcusOMarcusO Posts: 147Member
    Ok Guys, Check this out.

    I used the same rule as above from tenrdrmer.
    I can change back and forth between Pause and Play.

    I also added a Sound on and Sound mute functionality.
    I applying the same logic to the sound mute actor.

    What happens is puzzling. Yes the actors do change between sound muted and sound on but the paly and paus e buttons also change back and forth simultaneously???

    Whats going on here and how can i correct this???
  • tenrdrmertenrdrmer Posts: 9,934Member, Sous Chef, Senior Sous-Chef
    You have left the rules from pause and play in the other button or you are using the same attribute for both

    It's not my fault I never learned to take responsibility for anything. ;)

  • MarcusOMarcusO Posts: 147Member
    sorry i didn't think anybody was going to respond to this any more.

    I just put up another post about this problem...but to answer your question i'm using a different attribute i.e. Sound Muted.
  • tenrdrmertenrdrmer Posts: 9,934Member, Sous Chef, Senior Sous-Chef
    Well the you have probably left the rules for the play and pause in that button also.

    you dont have those actors overlapping do you. it it possible you are just touching both at once.

    It's not my fault I never learned to take responsibility for anything. ;)

  • MarcusOMarcusO Posts: 147Member
    same rules from the pause play in the other button...i have used the same logic but changed the variables and name etc. to be for the sound buttons.
  • tenrdrmertenrdrmer Posts: 9,934Member, Sous Chef, Senior Sous-Chef
    You need to double check it. There is a good chance you have missed one attribute somewhere.

    If you want post some screen shots of your rules. But unless you have left rules or attributes in there or have the play actor or an extra actor with those rules overlapping with the sound button there is no way they would interact.

    It's not my fault I never learned to take responsibility for anything. ;)

  • MarcusOMarcusO Posts: 147Member
    Those actors are not over lapping. They are on opposite ends of the screen, so i couldn't touch both at the same time.
  • MarcusOMarcusO Posts: 147Member
    Also I just double checked it as suggested. and everything checks out; no missing attribute.
  • tenrdrmertenrdrmer Posts: 9,934Member, Sous Chef, Senior Sous-Chef
    Post your screen shots man.

    I'm willing to bet you have missed something in one the actors They wouldn't never interact with each other otherwise

    It's not my fault I never learned to take responsibility for anything. ;)

  • MarcusOMarcusO Posts: 147Member
    i just took 3 screen shots to post. I feel stupid for asking this but how can i post this here?
  • tenrdrmertenrdrmer Posts: 9,934Member, Sous Chef, Senior Sous-Chef
    You have to upload it somewhere online or to a drop box file and then you can embed it using this code
    image

    Click quote to see the code

    And t has to be the actual URL of the image not a URL of a page the image is on.

    It's not my fault I never learned to take responsibility for anything. ;)

  • MarcusOMarcusO Posts: 147Member
    upload it online. Ok where can i upload it too. Sorry, as you can see im new to this.
    Also, i cant see your code you have in you prior response.
  • MarcusOMarcusO Posts: 147Member
    better yet, do you have a emai address you can send me so i can just send them to you as an email attachment.
  • tenrdrmertenrdrmer Posts: 9,934Member, Sous Chef, Senior Sous-Chef
    I really dont have time to do any free work through email.

    Click quote on my post and you will see the code to post a image.

    It's not my fault I never learned to take responsibility for anything. ;)

  • MarcusOMarcusO Posts: 147Member
    Hi There,
    I tried clicking quote. There mist be something wrong on my end clearly as i cant see the code. That sucks.. Oh well my loss.
    But thanks for your help for the time being. I appreciate it.
    I look forward to our interactions in the future.
  • tenrdrmertenrdrmer Posts: 9,934Member, Sous Chef, Senior Sous-Chef
    Its not big code. Its right there when I click Quote one little line.

    Look at this thread is also says how to do it.

    http://gamesalad.com/forums/topic.php?id=33

    I'm sorry I can't give all my time for this. If you would like you can check out my project help service. But I really think your just missing something and can get it fixed from checking all your rules. including your otherwises.

    It's not my fault I never learned to take responsibility for anything. ;)

This discussion has been closed.