Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Alpha Fading
#1
Well, currently I am working on an alpha fading way of doing day/night. What I have basically done is download a few codes from pscode and read a lot of stuff and have sort of learned it a bit. I am using the code from MRPGE and am not sure why I cannot get it working. I have had it so it flashes on the screen but thats all. So here is the code I am using.

In my GameLoop
Code:
' Draw night
        Call SquareAlphaBlend(frmMirage.picScreen.Width, frmMirage.picScreen.Height, frmMirage.picScreen.hdc, 0, 0, frmMirage.picBlack.hdc, 0, 0, 110)

The SquareAlphaBlend sub
Code:
Public Sub SquareAlphaBlend( _
ByVal cSrc_Widht As Integer, _
ByVal cSrc_Height As Integer, _
ByVal cSrc As Long, _
ByVal cSrc_X As Integer, _
ByVal cSrc_Y As Integer, _
ByVal cDest As Long, _
ByVal cDest_X As Integer, _
ByVal cDest_Y As Integer, _
ByVal nLevel As Byte)

    Dim LrProps As rBlendProps
    Dim LnBlendPtr As Long
    
    LrProps.tBlendAmount = nLevel
    CopyMemory LnBlendPtr, LrProps, 4
        
    AlphaBlend cDest, cDest_X, cDest_Y, cSrc_Widht, cSrc_Height, cSrc, cSrc_X, cSrc_Y, cSrc_Widht, cSrc_Height, LnBlendPtr
    
End Sub

Thats it, I have a big black picture box on frmMirage which should be blended onto the picScreen. The alphablend api is the same as any. If maybe there is an easier way of doing this and more efficient that would be nice to find out, thanks a lot for any help.
Reply
#2
Are you putting one picture box ontop of another?

If so (you didn't post the Alphablend code itself ¬_¬) then go learn to do it with DX.
Reply
#3
Just use fox 0___0 I think its efficient. And just alpha blend it till 255-0
Reply
#4
Fox isn't efficient XD

Infact, most AB methods in 7 aren't efficient.

Llllaaagggyyyy
Reply
#5
Fox isn't efficient XD

Infact, most AB methods in Mirage won't work well
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)