Mirage Source http://miragesource.net/forums/ |
|
Hmm... http://miragesource.net/forums/viewtopic.php?f=201&t=2382 |
Page 1 of 3 |
Author: | jsventor [ Wed Aug 01, 2007 10:17 pm ] |
Post subject: | Hmm... |
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 |
Author: | Robin [ Wed Aug 01, 2007 10:21 pm ] |
Post subject: | Re: Hmm... |
And you need help with what? |
Author: | jsventor [ Wed Aug 01, 2007 10:30 pm ] |
Post subject: | Re: Hmm... |
It doesent work, When I click on the game screen nothing appears, no errors either |
Author: | Robin [ Wed Aug 01, 2007 10:58 pm ] |
Post subject: | Re: Hmm... |
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 |
Author: | jsventor [ Thu Aug 02, 2007 12:03 am ] |
Post subject: | Re: Hmm... |
Still doesent work, is there a certain place I should put this code? |
Author: | jsventor [ Thu Aug 02, 2007 12:15 am ] |
Post subject: | Re: Hmm... |
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 |
Author: | Dragoons Master [ Thu Aug 02, 2007 12:33 am ] |
Post subject: | Re: Hmm... |
LblMenu.Show is not valid... I think you meant LblMenu.Visible = True |
Author: | jsventor [ Thu Aug 02, 2007 12:36 am ] |
Post subject: | Re: Hmm... |
I tried but then nothing happened |
Author: | Coke [ Thu Aug 02, 2007 6:33 pm ] |
Post subject: | Re: Hmm... |
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 |
Author: | jsventor [ Thu Aug 02, 2007 6:48 pm ] |
Post subject: | Re: Hmm... |
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. |
Author: | Ambientiger [ Thu Aug 02, 2007 7:51 pm ] |
Post subject: | Re: Hmm... |
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. |
Author: | jsventor [ Thu Aug 02, 2007 7:56 pm ] |
Post subject: | Re: Hmm... |
ahh ok, thanks for the explination. Have a fix? |
Author: | Ambientiger [ Fri Aug 03, 2007 9:00 pm ] |
Post subject: | Re: Hmm... |
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. |
Author: | jsventor [ Fri Aug 03, 2007 11:00 pm ] |
Post subject: | Re: Hmm... |
ok thx I'll try it out. |
Page 1 of 3 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |