14-06-2008, 10:36 PM
I'm trying to get a scrolling parallax background thing going on...and it's not working too well. What I'm basically trying to do is get one picture to follow the other down, but above the picture to get it to look like it's continually moving down...
I know it's going to be probably messed up a lot...anybody help?
Code:
Dim sRECTT As RECT
Dim sRECTT2 As RECT
Dim dRECTT As RECT
Dim tmrBlah As Long
Dim tmrBlah2 As Long
Me.Visible = True
With dRECTT
.top = 0
.Bottom = 400
.Left = 0
.Right = 400
End With
With sRECTT
.top = 0
.Bottom = 400
.Left = 0
.Right = 400
End With
With sRECTT2
.top = -400
.Bottom = 0
.Left = 0
.Right = 400
End With
Do
If tmrBlah < GetTickCount Then
With sRECTT
.top = .top - 1
.Bottom = .top + 400
End With
With sRECTT2
.top = .top - 1
.Bottom = .Bottom - 1
End With
tmrBlah = GetTickCount + 10
End If
If sRECTT.top = -400 Then sRECTT.top = 0
DD_Background.BltToDC picBack.hdc, sRECTT, dRECTT
DD_Background.BltToDC picBack.hdc, sRECTT2, dRECTT
If tmrBlah2 < GetTickCount Then
picBack.Refresh
tmrBlah2 = GetTickCount + 10
End If
DoEvents
Loop
End Sub
I know it's going to be probably messed up a lot...anybody help?