Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with Displaying Character Sprites
#1
Hello, I have recently added grimsk8ter11's "Display Sprite At Character Create" tutorial
http://web.miragesource.com/forums/viewt...?f=75&t=32

and I played around with one line of code to display the character facing south. And it works fine. The code I changed was the timer's function to this (I removed the Male and Female If-Then Statement and added the PIC_X * 3 to where a 0 was in the bitBlt.
Code:
Private Sub timNew_Timer()
    Call BitBlt(picpic.hdc, 0, 0, PIC_X, PIC_Y, picSprites.hdc, PIC_X * 3, Int(Class(cmbClass.ListIndex).Sprite) * PIC_Y, SRCCOPY)
End Sub

And, I was trying to display it so that the picture box displayed a character walking loop (i.e. It shows the first frame, second frame, first frame, second frame, etc.) So, I came up with this code:

Code:
Private Sub timNew_Timer()
Dim is Byte
i = 0
    Select Case i
    Case 0
        Call BitBlt(picpic.hdc, 0, 0, PIC_X, PIC_Y, picSprites.hdc, PIC_X * 3, Int(Class(cmbClass.ListIndex).Sprite) * PIC_Y, SRCCOPY)
        i = i + 1
    Case 1
        Call BitBlt(picpic.hdc, 0, 0, PIC_X, PIC_Y, picSprites.hdc, PIC_X * 4, Int(Class(cmbClass.ListIndex).Sprite) * PIC_Y, SRCCOPY)
        i = 0
    End Select
End Sub

But it didn't work, So I played around with the timer interval, making update once every second, but still no luck.

I was wondering if anyone could possibly point me in the right direction (don't just fix it for me, but tell me what is wrong and maybe a hint on how to fix it).

Also, all sprites are 32x32.

Thank you.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)