3 Replies Latest reply on Apr 9, 2008 6:45 AM by Newsgroup_User

    alpha blend

    Level 7
      Hi,

      I am trying to make an alpha blend that looks like it is 'rolling' from
      the top to the bottom but the alpha channel looks broken when I use the
      set alpha method.

      Does anyone know what I am doing wrong in this behavior?

      TIA


      property this, pImage, pImage2, pMode, pPos, palpha

      on beginsprite me
      this = sprite(me.spritenum)
      pImage = this.member.image.duplicate()
      palpha = pImage.extractAlpha()

      -- this.member.image = al

      pImage2 = Image(palpha.width,palpha.height,palpha.depth)
      this.member.image.setalpha( pImage2)

      pMode = #fadein
      pPos = 0
      end

      on enterframe me

      if pPos < palpha.height then
      sRect = rect(0,pPos,pAlpha.width,pPos+5)

      dRect = sRect
      --pImage2.copypixels(palpha,sRect, dRect,{#ink: #blend,#blend: 100})
      pImage2.copypixels(palpha,sRect, dRect)

      pPos = pPos +5

      this.member.image.setalpha( pImage2)

      end if

      end

      on endsprite me

      this.member.image = pImage

      end