Sliding Inventory Tray?

I need some help with a scene. This landscape scene that has an inventory tray that slides out to reveal actors. If the user selects an actor in the tray it spawns a copy of the actor in the scene & the tray slides closed back to a small tab. The inventory tray slides out on a rule that is based on "if actor receives touch is pressed". However when my touch is released the tray closes before I can select an actor. How can I make the inventory tray stay open until 1) an actor is selected OR 2) inventory tab area (non inventory actor pressed) OR 3) the main scene area pressed?

Thanks

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Don't base your inventory tray's position on a Touch is Pressed/Released rule. Instead, have When Touch is Pressed --> change attribute game.visible to true. Then have a separate rule for When attribute game.visible=true --> Interpolate to new position, etc.

    That way you control when the tray is visible rather than it being dependent on when touch is pressed/released.
  • sawkasteesawkastee Member Posts: 184
    I'll post my rules when I get home.
  • sawkasteesawkastee Member Posts: 184
    @tatiang

    I probably didn't explain myself very well. I'm not making the inventory tray position based on touch position. The tray is always on the right side of the screen sticks out 64 pixels. When touch is pressed it opens. Unfortunately it closes after touch is released and I don't want that. I want it to stay open until 1) an inventory actor is selected OR 2) inventory tab area (64 pixel tab is pressed) OR 3) the main scene area pressed?
    Here are my slider rules (inventory tray).

    https://www.dropbox.com/s/lt7pew0e5xogniz/Screen Shot 2013-03-13 at 10.39.58 PM.png

    https://www.dropbox.com/s/q187okc3dcw93wd/Screen Shot 2013-03-13 at 10.40.13 PM.png
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You need to take away the Change Attribute game.inv_open to 0 behavior from the Otherwise section. You don't want a Touch is Pressed rule to have an Otherwise section that triggers when you release the touch. You just want game.inv_open to change to 1 and then you can change game.inv_open to 0 in a different rule (e.g. when an inventory actor is selected).
  • sawkasteesawkastee Member Posts: 184
    @tatiang

    ahhhhh.....i still can't get it. can you help me with this file?

    https://www.dropbox.com/sh/hy4x99el8dnig9d/Szr5iNUx7U
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited March 2013
    @sawkastee Your rules in your slider are correct but you unlocked the instance on the scene so it's not following those rules.

    Just click Revert to Protoype and you'll see it works much better.
Sign In or Register to comment.