Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Feature] Visual Inventory
#30
Sorry for the double post, however, I have a question about how to get this to work.

Here is the problem, the sub works ALMOST correctly. It see's the items as the first pixels in the upper lefthand part of the picVisInv, not the actual blting of the item.

I tried messing with the InvPosX, InvPosY, X, Y, and I still can't seem to get it to move off of those pixels. Can anyone help me out with this? I have the standard 32 * 32 pixel items, and a 5 pixel offset between the top and sides of the picVisInv, and 5 pixel offset between the item pics. I know that I need to add in the offset, and the 32 * 32 pixels for the pics so the picItemDesc shows up when actually on the pictue. I wouldn't be too worried about this, I might take it out, however the other subs to drop and use the items are based on this, so scrolling over the actual item and double-clicking etc. does nothing.

[spoiler]
Code:
Private Sub picVisInv_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim i As Long
Dim InvNum As Long
Dim ItemNum As Long

    InvPosX = X
    InvPosY = Y

    InvNum = IsItem(X, Y)
    
    If InvNum  0 Then

        ItemNum = GetPlayerInvItemNum(MyIndex, InvNum)

        lblItemName.Caption = Trim$(Item(ItemNum).Name)

        picItemDesc.Visible = True
        Exit Sub
    Else
        lblItemName.Caption = ""
    End If

End Sub
[/spoiler]

Edit: I've been thinking a little more into this, and I still do not know what to do to fix this, however I believe that what I need to change is not in the above sub, it's in the IsItem Function. I'm using the default IsItem Function (with only a change of the 4 - 8, just changing the amount of columns of items in the visual inventory. I posted the code below, for anyone to lazy to go look at it above, or who wants a look at my specific code.

[spoiler][code]Private Function IsItem(ByVal X As Single, ByVal Y As Single) As Long
Dim tempRec As RECT
Dim i As Long

For i = 1 To MAX_INV
If GetPlayerInvItemNum(MyIndex, i) > 0 And GetPlayerInvItemNum(MyIndex, i) = tempRec.Left And X = tempRec.Top And Y
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)