Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] DirectDraw7


VitinhooxD
 Share

Recommended Posts

Hey , i am trying to learn Direct Draw surfaces for a code im doing and i just keep failing =X , i have done a sub based to BltPlayerSpells , and when i try to call it , nothing happens.
```
Sub LoadHotBarImages()
    Dim i As Long, x As Long, Y As Long, spellnum As Long, spellicon As Long
    Dim Amount As String
    Dim rec As RECT, rec_pos As RECT
    Dim colour As Long

    If Not InGame Then Exit Sub
    frmMainGame.picHotBar.Cls

    For i = 1 To 10
        spellnum = HotBar(MyIndex).slot(i)

        If spellnum > 0 And spellnum <= MAX_SPELLS Then
            spellicon = spell(spellnum).Icon

            If spellicon > 0 And spellicon <= NumSpellIcons Then

                With rec
                    .Top = 0
                    .Bottom = 32
                    .Left = 0
                    .Right = 32
                End With

                With rec_pos
                    .Top = SpellTop + ((SpellOffsetY + 32) * ((i - 1) \ SpellColumns))
                    .Bottom = .Top + PIC_Y
                    .Left = SpellLeft + ((SpellOffsetX + 32) * (((i - 1) Mod SpellColumns)))
                    .Right = .Left + PIC_X
                End With

                ' Load spellicon if not loaded, and reset timer
                SpellIconTimer(spellicon) = GetTickCount + SurfaceTimerMax

                If DDS_SpellIcon(spellicon) Is Nothing Then
                    Call InitDDSurf("SpellIcons\" & spellicon, DDSD_SpellIcon(spellicon), DDS_SpellIcon(spellicon))
                End If

                Engine_BltToDC DDS_SpellIcon(spellicon), rec, rec_pos, frmMainGame.picHotBar, False
            End If
        End If
    Next
End Sub
```
ABove its the sub i am trying to call.IS there anything wrong with it?Thanks , vitin.
Link to comment
Share on other sites

I have made a hotbar(playerindex).slot(1 to 10) array which I setup and got it working.it returns the spell number of an slot of the hotbar.so I can use  a spell rec with the hotbar like

IE

Spell(hotbar(myindex).slot(1)).vital

Edit:i have got everything working the only thing left is the loadhotbarimages subZ
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...