2 Replies Latest reply on Mar 17, 2008 8:10 AM by Newsgroup_User

    visibility of sprites

    Banton11
      Hello
      I hope I can explain this properly.. I need to create a button which lets the user show or hide a number of sprites. A new sprite will appear each time the user clicks 'next' but i need all of them to be either hidden or showing when the user presses the show/hide button, even if only half are showing when they press it. Does that make sense?

      I have some code which is something like

      buttonPress = true
      sprite(1).visibility = buttonPress
      sprite(2).visibility = buttonPress

      buttonPress = NOT buttonPress

      but i'm not exactly sure where i'm putting these pieces of code, or if they work....

      Thanks, hope that makes some kind of sense!
        • 1. Re: visibility of sprites
          ali666
          you can use of blend property

          sprite(1).blend = 0 -- invisible
          sprite(1).blend = 100 -- visible
          • 2. Re: visibility of sprites
            Level 7
            The property you're looking for is "visible" not "visibility". Setting
            "blend" to 0 works as well, but a 0-blend sprite can still be clicked on and
            otherwise interact with the mouse, so if you don't want the invisible
            sprites clickable, you shouldn't use this method. Another common method is
            to move the sprites off stage, so they're still around but not able to be
            interacted with by the user. A simple:
            sprite(X).locH = sprite(X).locH - 2000
            to move it offstage and then change the - to + to move it back onstage will
            work. (2000 should be enough for most users unless you're running a
            full-screen projector on multiple monitors, in which case you can just
            increase this value accordingly, or use locV instead, etc.)