Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hmm...
#1
Tryin to get a label to open up by right clicking anywhere whil playing the game, heres what I have so far...



Private Sub Object_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = 2 Then

LblMenu.Show

End If

End Sub
Reply
#2
And you need help with what?
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#3
It doesent work, When I click on the game screen nothing appears, no errors either
Reply
#4
Private Sub picScreen_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = 2 Then

LblMenu.Show

End If

End Sub
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#5
Still doesent work, is there a certain place I should put this code?
Reply
#6
Heres where I put it, in Picscreen code, but I also have click to move so I had to edit, whenevr I put .show it sais method or data not found, heres the code



Code:
If MouseCheck = True Then
            If Button = 2 Then
            If LblMenu.Visible = True Then
            LblMenu.Visible = False
                XToGo = (X + (NewPlayerX * PIC_X)) / PIC_X
                YToGo = (Y + (NewPlayerY * PIC_Y)) / PIC_Y
                Call CheckMapGetItem
            ElseIf LblMenu.Visible = False Then
            LblMenu.Show
            End If
            End If
           End If
Reply
#7
LblMenu.Show is not valid... I think you meant LblMenu.Visible = True
Reply
#8
I tried but then nothing happened
Reply
#9
Private Sub Object_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = 2 Then

LblMenu.visible = 1

End If

End Sub
Reply
#10
Fox Wrote:Private Sub Object_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = 2 Then

LblMenu.visible = 1

End If

End Sub


I've tried this and it didnt work, my soiurce has click to move, so I have to kinda blend it in.
Reply
#11
jsventor Wrote:Heres where I put it, in Picscreen code, but I also have click to move so I had to edit, whenevr I put .show it sais method or data not found, heres the code



Code:
If MouseCheck = True Then
            If Button = 2 Then
            If LblMenu.Visible = True Then
            LblMenu.Visible = False
                XToGo = (X + (NewPlayerX * PIC_X)) / PIC_X
                YToGo = (Y + (NewPlayerY * PIC_Y)) / PIC_Y
                Call CheckMapGetItem
            ElseIf LblMenu.Visible = False Then
            LblMenu.Show
            End If
            End If
           End If


I've noticed you make 'LblMenu.Visible = False' if the label is already showing and make no allowance for it to be shown again, the 'LblMenu.Show', or 'LblMenu.Visible = True' as it should be is part of the 'ElseIf' and will be stepped over if LblMenu is visible.
Reply
#12
ahh ok, thanks for the explination. 8)

Have a fix?
Reply
#13
I was having a little think about this at work today, do you need the movement only to execute when the label is showing.
If not, I would seperate out If statement that checks if LblMenu is visible, like this;

Code:
If MouseCheck = True Then
       If Button = 2 Then
            XToGo = (X + (NewPlayerX * PIC_X)) / PIC_X
            YToGo = (Y + (NewPlayerY * PIC_Y)) / PIC_Y
            Call CheckMapGetItem
            If LblMenu.Visible = True Then
                LblMenu.Visible = False
            Else
                LblMenu.Visible = True
            End If
        End If
    End If

In theory this should cause LblMenu to appear at the place it is on your Piscreen picbox on a right click, then disappear again on the next click.
Reply
#14
ok thx I'll try it out.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)