2 Replies Latest reply on Jan 11, 2007 4:33 PM by james_baron

    mask ink trouble

      when using the mask ink, im wondering how to keep the mask stationary as the sprite moves.. the way i am using it as soon as the sprite with the bitmat mask applyed to it moves the mask moves with it. i need the mask to remain in the same place so that the sprite can move around and the mask hide different parts of the sprite.

        • 1. Re: mask ink trouble
          Level 7
          You will need to change the regpoint of the mask member when you move
          the sprite. Mask ink in Director uses the cast member that is next to
          the member of the sprite that is set to use mask ink. This method made
          sense once upon a time, but is really difficult to work with now.

          Since the mask member is not actually represented on the stage, it's
          position is always relative to it's regpoint and the regpoint of the
          member it is masking. As you've seen, if you move the sprite 2 pixels to
          the right, the mask moves the same distance. To keep the mask in a
          static location, you have to change it's regpoint as you move the sprite.

          Here's an example behavior:

          property thisSprite -- the sprite to be animated
          property thisMember -- the member of the sprite
          property maskMember -- the member used as a mask

          on beginSprite me
          thisSprite = me.spriteNum
          thisMember = sprite(thisSprite).member
          maskMember = member(thisMember.memberNum + 1, thisMember.castLib).name

          on mouseUp me
          sprite(thisSprite).locH = sprite(thisSprite).locH + 3
          member(maskMember).regPoint = member(maskMember).regPoint - point(3,0)

          As you click on the sprite, it will move to the right and the mask's
          regpoint will be moved to the left, making the mask seem to stay in
          place as the sprite moves.

          Does this help?

          Rob Dillon
          Adobe Community Expert

          • 2. Re: mask ink trouble
            james_baron Level 1
            thanks for that!!