Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Meh
#1
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...

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?
Reply
#2
I'm pretty sure you can't render off-screen in DX7.

Is it not appearing at all? If so, that's probably why.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#3
No, it's appearing, it's just a moving block going down alone and then it appears at the top and repeats the process. The blocks aren't following each other to make it look like it's continuous...just that lonely block moving down.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)