VitinhooxD Posted September 12, 2010 Author Share Posted September 12, 2010 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 NextEnd 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 More sharing options...
westin444 Posted September 12, 2010 Share Posted September 12, 2010 are your spell icons .bmp like all the other ones? Link to comment Share on other sites More sharing options...
VitinhooxD Posted September 12, 2010 Author Share Posted September 12, 2010 Yes. Link to comment Share on other sites More sharing options...
Robin Posted September 12, 2010 Share Posted September 12, 2010 Probably to do with the fact that you're using all the spell constants and variables.If you're going to do a Hotbar, you need to re-do all those bits yourself. Link to comment Share on other sites More sharing options...
VitinhooxD Posted September 12, 2010 Author Share Posted September 12, 2010 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 likeIESpell(hotbar(myindex).slot(1)).vitalEdit:i have got everything working the only thing left is the loadhotbarimages subZ Link to comment Share on other sites More sharing options...
westin444 Posted September 13, 2010 Share Posted September 13, 2010 is autoredraw for your picture box set to true? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now