VitinhooxD Posted September 12, 2010 Author Share Posted September 12, 2010 Hello.Well this is the third massive bug I have found with my code.I have made a sub that loads a picture on an certain image in frmMainGame based on your hotbar skill number in a certain slot.In the first time I try to use it , it only sets the variables but doesnt load the images.Then I try it again and it works perfectly.Well here is the subs :PS: YeahHotBar sets the hotbar variable.I dunno why I have put this name into it.PS2: All the packets are set up.LoadImages Sub:```Sub LoadHotBarImages(ByVal Index As Long)Dim number As LongDim skill As StringDim i As LongFor number = 1 To 10LoadHotBar (number)NextfrmMainGame.picHotBar.Picture = frmMainGame.picTempBank.PictureFor i = 1 To 10If HotBar(Index).slot(i) <> "0" Thenskill = CLng(HotBar(Index).slot(i))number = spell(skill).IconfrmMainGame.Image1(i).Picture = LoadPicture(App.Path & "\data files\graphics\spellicons\" & number & ".gif")ElsefrmMainGame.Image1(i).Picture = frmMainGame.picTempBank.PictureEnd IfNextEnd Sub```Here is how I call it:```Private Sub picSpells_DblClick() Dim spellnum As LongDim i As LongFor i = 1 To 10LoadHotBar (i)Next spellnum = IsPlayerSpell(SpellX, SpellY) If spellnum <> 0 Then For i = 1 To 10 If GetHotBar(MyIndex, i) = "0" Then Call YeahHotBar(i, spellnum) LoadHotBar (i) LoadHotBarImages (MyIndex) Exit Sub End If Next End IfEnd Sub```Thanks , Vitin. Link to comment Share on other sites More sharing options...
Robin Posted September 12, 2010 Share Posted September 12, 2010 Look at how I handle rendering graphics to the UI. That's how you should do it.Having an array of picture boxes is how you would do it in old versions of Eclipse. You're using Origins now. Shape up. 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