Flaw Posted November 6, 2009 Author Share Posted November 6, 2009 Okay so I made a custom GUI for the NewCharacter form.. And I can't get the sprite thing to show up correctly. It was fine at first, then I tried to move all the sprite things down, and now it doesnt show up.. Soo I have no idea how to fix that =pHere's an s/s of what happens in the client:http://img690.imageshack.us/img690/4854/errorlm.jpgHere's my project in vb:http://img22.imageshack.us/img22/9936/projecterror.jpgPlease help, this is a big setback =p Link to comment Share on other sites More sharing options...
Kimimaru Posted November 7, 2009 Share Posted November 7, 2009 If you haven't made any changes to the code, make sure your code for the **Private Sub Timer1_Timer()** is as follows:```Private Sub Timer1_Timer() If cmbClass.ListIndex < 0 Then Exit Sub End If If 0 + CustomPlayers = 0 Then If SpriteSize = 1 Then If optMale.Value = True Then frmNewChar.Picsprites.Left = (animi * PIC_X) * -1 frmNewChar.Picsprites.Top = (Int(Class(cmbClass.ListIndex).MaleSprite) * 64) * -1 Call BitBlt(Picpic.hDC, 0, 0, PIC_X, 64, Picsprites.hDC, animi * PIC_X, Int(Class(cmbClass.ListIndex).MaleSprite) * 64, SRCCOPY) Else frmNewChar.Picsprites.Left = (animi * PIC_X) * -1 frmNewChar.Picsprites.Top = (Int(Class(cmbClass.ListIndex).FemaleSprite) * 64) * -1 Call BitBlt(Picpic.hDC, 0, 0, PIC_X, 64, Picsprites.hDC, animi * PIC_X, Int(Class(cmbClass.ListIndex).FemaleSprite) * 64, SRCCOPY) End If Else If optMale.Value = True Then frmNewChar.Picsprites.Left = (animi * PIC_X) * -1 frmNewChar.Picsprites.Top = (Int(Class(cmbClass.ListIndex).MaleSprite) * PIC_Y) * -1 Call BitBlt(Picpic.hDC, 0, 0, PIC_X, PIC_Y, Picsprites.hDC, animi * PIC_X, Int(Class(cmbClass.ListIndex).MaleSprite) * PIC_Y, SRCCOPY) Else frmNewChar.Picsprites.Left = (animi * PIC_X) * -1 frmNewChar.Picsprites.Top = (Int(Class(cmbClass.ListIndex).FemaleSprite) * PIC_Y) * -1 Call BitBlt(Picpic.hDC, 0, 0, PIC_X, PIC_Y, Picsprites.hDC, animi * PIC_X, Int(Class(cmbClass.ListIndex).FemaleSprite) * PIC_Y, SRCCOPY) End If End If End IfEnd Sub```That's the only thing I can think of that may cause the problem. Link to comment Share on other sites More sharing options...
Flaw Posted November 7, 2009 Author Share Posted November 7, 2009 Nope no luck.I think that its because I screwed up the alignment of the picture boxes.. And I don't know what they're supposed to be =p Link to comment Share on other sites More sharing options...
Kimimaru Posted November 7, 2009 Share Posted November 7, 2009 Make sure you have this in the code for the form:```Private Sub Form_Load() Dim i As Integer Dim Ending As String For i = 1 To 3 If i = 1 Then Ending = ".gif" End If If i = 2 Then Ending = ".jpg" End If If i = 3 Then Ending = ".png" End If If FileExists("GUI\NewCharacter" & Ending) Then frmNewChar.Picture = LoadPicture(App.Path & "\GUI\NewCharacter" & Ending) End If Next i If CustomPlayers = 1 Then If FileExists("GFX\Sprites.bmp") Then Picsprites.Picture = LoadPicture(App.Path & "\GFX\Sprites.bmp") Else Call MsgBox("Error: Could not find Sprites.bmp.") End End If End IfEnd Sub```If that doesn't work, then check to see if your **picSprites** PictureBox is anywhere near where the player sprites are supposed to show up. Link to comment Share on other sites More sharing options...
balliztik1 Posted November 7, 2009 Share Posted November 7, 2009 Just download a clean source and cut the sprite box out. Link to comment Share on other sites More sharing options...
Flaw Posted November 7, 2009 Author Share Posted November 7, 2009 I was going to, but I couldn't figure out how to copy the sprite box over =pI've literally been using vb for 19 hours. Lmao Link to comment Share on other sites More sharing options...
balliztik1 Posted November 7, 2009 Share Posted November 7, 2009 You can just take the form file from the fresh copy, and import it into your project. Then, just take the picture box and cut and paste it onto your form. Link to comment Share on other sites More sharing options...
Flaw Posted November 7, 2009 Author Share Posted November 7, 2009 Alright thanks you two =] 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