Mirage Engine
Hmm... - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Hmm... (/showthread.php?tid=1148)



Hmm... - jsventor - 01-08-2007

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


Re: Hmm... - Robin - 01-08-2007

And you need help with what?


Re: Hmm... - jsventor - 01-08-2007

It doesent work, When I click on the game screen nothing appears, no errors either


Re: Hmm... - Robin - 01-08-2007

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


Re: Hmm... - jsventor - 02-08-2007

Still doesent work, is there a certain place I should put this code?


Re: Hmm... - jsventor - 02-08-2007

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



Re: Hmm... - Dragoons Master - 02-08-2007

LblMenu.Show is not valid... I think you meant LblMenu.Visible = True


Re: Hmm... - jsventor - 02-08-2007

I tried but then nothing happened


Re: Hmm... - Coke - 02-08-2007

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


Re: Hmm... - jsventor - 02-08-2007

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.


Re: Hmm... - Ambientiger - 02-08-2007

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.


Re: Hmm... - jsventor - 02-08-2007

ahh ok, thanks for the explination. 8)

Have a fix?


Re: Hmm... - Ambientiger - 03-08-2007

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.


Re: Hmm... - jsventor - 03-08-2007

ok thx I'll try it out.