Actions, Image, and background

DevilsDevils Member Posts: 561
edited November -1 in Working with GS (Mac)
Alright I don't know how to begin this issue. I am trying to figure out why when my image is pressed in the outer sections it still has the behavior that I set the image to have. I only want the action to take place if the image itself is touched not both the image and the outer background. Can someone please help?

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You could prob set some sort of if touch is pressed rule for the back ground that changes an attribute to one on press and 0 on release then set a rule on your actor to check if that attribute is 1 or 0 and only do its action when touch is pressed and that attribute is 0

    Good Luck
  • JoeMeisterJoeMeister Member Posts: 602
    In your Rule:
    If Actor receives event-touch is pressed
    click the plus sign to the right and select:
    If Actor receives event-touch is inside
  • JackBQuickJackBQuick Member Posts: 524
    @ Devils -- I'm not sure whether I'm reading your problem correctly but it seems to me that you have a PNG with a transparent background. When you click on the transparent part, it activates the behaviour that you would like to only occur in the opaque areas. Unfortunately, pixel collision is not part of GameSalad yet -- the entire area of the image (not just the opaque parts) can be activated by touch. I wonder though, whether changing your collision area to circular (rather than rectangular) would help...
  • jweaver911jweaver911 Member Posts: 439
    if what Jack said isn't enough there's always the ability to create another image/actor to be your collision shape(with alpha of "0") and just constrain it to the location of your visible(i.e. real) actor.
  • DevilsDevils Member Posts: 561
    Wow I appreciate all the help here guys. I'm not that good at gs yet but. I will continue to learn new things I think Joe is right on track with what I'm trying to do so I'll give that a go first and see what happens just got home from work.
  • DevilsDevils Member Posts: 561
    Alright I tried it and nothing worked. Whenever I tap my image the right behavior activates but also when the background is tapped. My background is not transparent.
  • JackBQuickJackBQuick Member Posts: 524
    Need some clarification to understand the issue:

    1) In your original post, why did you say "outer" background rather than just background?
    2) Is your background an actor? If so, are there any behaviors within it?
    3) Does this behavior(i.e. what happens when you click) take place everywhere on the background or only in certain parts?
    4) Describe the image.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    If i understand correctly you are saying when you touch is say half on the actor and half on the background, it is performing the behavior? Is that correct?
    Also the transparent comment is not about the back ground its about your actor. If you have say and actor that you want to be 40x40 but in the image file there is another 40px all the way around your image that is transparent GS uses all that area for your actor as well. You will need to crop all of the transparent stuff out of .png file
  • DevilsDevils Member Posts: 561
    I will try to explain this better but I am not sure if I can. Ok I have a picture with something in the middle of it for example purposes well say its a bird but behind the bird there is a brick wall. i want the player to tap the bird and the bird to sing, but instead when I tap the bird and the brick wall it sings I only need the bird to sing not the brick wall. Hopefully this is a better explanation I don't want to sound like an a$$ but thats the best way I could explain.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    So your bird and brick wall are in the same .png file?
Sign In or Register to comment.