Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[MS4How would i be able to change the sprite format to this?
#1
How can i change the default sprite template in vb6? from ms4 format to rpgmaker format but in the same way as they are now in separate files

Like File 1
Sprite1.bmp (or something)
[Image: 70b166217121886065c747cbe97b6ad2.png]

File 2
Sprite2.bmp (Instead of 1 Sprites.bmp)
[Image: 9e2a652de3912e30d5f9dfcf393b9ba6.png]
Reply
#2
[Image: rawrup.png]

[Image: sprite1.png]

Code:
Public Sub DrawSprite(ByVal X As Long, ByVal Y As Long, ByVal Dir As Byte)
Dim srcRECT As DxVBLibA.RECT

    With CDX8
        .SetTexture TextureID.sprite1
        Select Case Dir
            Case 1 'Up
                srcRECT.Top = 96 '0
            Case 2 'Down
                srcRECT.Top = 0 '96
            Case 3 'Left
                srcRECT.Top = 32
            Case 4 'Right
                srcRECT.Top = 64
        End Select
        
        srcRECT.Left = 33
        srcRECT.Right = srcRECT.Left + 32
        srcRECT.bottom = srcRECT.Top + 32
            
        .TextureControl X * 4, Y * 4, srcRECT.Right - srcRECT.Left, srcRECT.bottom - srcRECT.Top, srcRECT.Left, srcRECT.Top, , False
        .Draw
    End With
End Sub
Reply
#3
Where would i put this i tried to find it but there is none...
Reply
#4
bluedude13 Wrote:Where would i put this i tried to find it but there is none...

It's just an example, you'll need to edit BltPlayer to do it yourself.
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
#5
Yeah it's really simple.
Reply
#6
Ahh man i tried but i get lots of errors can some one help?


Code:
Public Sub BltPlayer(ByVal Index As Long)
Dim Anim As Long
Dim I As Long
Dim SpellNum As Long
Dim X As Long
Dim Y As Long
Dim Sprite As Long
Dim rec As DXVBLib.RECT

    Sprite = GetPlayerSprite(Index)

    ' Check for animation
    Anim = 0
    If Player(Index).Attacking = 0 Then
        Select Case GetPlayerDir(Index)
            Case DIR_UP
                If (Player(Index).YOffset < SIZE_Y / 96) Then Anim = 1
            Case DIR_DOWN
                If (Player(Index).YOffset < SIZE_Y / 0 * -1) Then Anim = 1
            Case DIR_LEFT
                If (Player(Index).XOffset < SIZE_Y / 32) Then Anim = 1
            Case DIR_RIGHT
                If (Player(Index).XOffset < SIZE_Y / 64 * -1) Then Anim = 1
        End Select
    Else
        If Player(Index).AttackTimer + 500 > GetTickCount Then
            Anim = 2
        End If
    End If
    
    ' Check to see if we want to stop making him attack
    With Player(Index)
        If .AttackTimer + 1000 < GetTickCount Then
            .Attacking = 0
            .AttackTimer = 0
        End If
    End With
    
    With rec
        .Top = 0
        .Bottom = SIZE_Y
        .Left = (GetPlayerDir(Index) * 3 + Anim) * SIZE_X
        .Right = .Left + SIZE_X
    End With
    
    X = GetPlayerX(Index) * SIZE_X + Player(Index).XOffset
    Y = GetPlayerY(Index) * SIZE_Y + Player(Index).YOffset - 4 ' to raise the sprite by 4 pixels
    
    ' Check if its out of bounds because of the offset
    If Y < 0 Then
        Y = 0
        With rec
            .Top = .Top + (Y * -1)
        End With
    End If
Reply
#7
Code:
With rec
        .Top = GetPlayerDir(Index) * SIZE_Y
        .Bottom = .Top + SIZE_Y
        .Left = Anim * SIZE_X
        .Right = .Left + SIZE_X
    End With

That should be it.
Reply
#8
But now it says ERROR Missing file
Reply
#9
Umm ok that has nothing to do with BltPlayer. How are you loading your sprites?
Reply
#10
Well i just changed my sprite to Sprite 16 ( the rpg maker sprite format) and then i changed it to 2.bmp or 17.bmp and everytime it says its missing...
Reply
#11
Did you actually place .BMP files in there, or did you put .PNG files in there?
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
#12
it was a Bmp why should it be png?
Reply
#13
The sprites you showed us are PNGs.
Reply
#14
Hmm wait..
Reply
#15
Open them in paint and save as 24-bit BMPs. And make sure the first sprite file is sprite0 or sprite1 I forgot what it starts at.
Reply
#16
It works now but everything back wards like i tried switching the code around but it didn't work

THis is how its like

|How its supposed to be| |How it is now Sad|
left------------------------------------>Right
right---------------------------------->Up
up------------------------------------->Down
Down---------------------------------->Left
Reply
#17
Code:
Select Case GetPlayerDir(MyIndex)
        Case DIR_DOWN
            .Top = DIR_LEFT * SIZE_Y
        Case DIR_LEFT
            .Top = DIR_DOWN * SIZE_Y
        Case DIR_RIGHT
            .Top = DIR_UP * SIZE_Y
        Case Dir_UP
            .Top = DIR_RIGHT * SIZE_Y
    End Select
    
    With rec
        .Bottom = .Top + SIZE_Y
        .Left = Anim * SIZE_X
        .Right = .Left + SIZE_X
    End With
Reply
#18
Aww i cant do it Sad i keep getting so many errors and i cannot find the GetplayerDir your talking about all you do is paste the code!
Sorry.
Reply
#19
Oops just change MyIndex to Index there...
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)