Mirage Source http://miragesource.net/forums/ |
|
idea for future builds : toggle menus http://miragesource.net/forums/viewtopic.php?f=195&t=4173 |
Page 1 of 1 |
Author: | VersionX [ Sun Aug 17, 2008 10:54 pm ] |
Post subject: | idea for future builds : toggle menus |
When you click a menu icon (ex: inventory), it opens. When you click it again, it closes. Basically, the have icons toggle menus on/off. Or is this programmable on our side? =D EDIT: Great work so far gentlemen. |
Author: | Acruno [ Sun Aug 17, 2008 10:58 pm ] |
Post subject: | Re: idea for future builds : toggle menus |
VersionX wrote: Or is this programmable on our side? =D Um..how many sides are there? |
Author: | Poyzin [ Sun Aug 17, 2008 11:26 pm ] |
Post subject: | Re: idea for future builds : toggle menus |
VersionX wrote: When you click a menu icon (ex: inventory), it opens. When you click it again, it closes. Basically, the have icons toggle menus on/off. This is very easy to do. Other engines have this O.o |
Author: | Anthony [ Mon Aug 18, 2008 12:06 am ] |
Post subject: | Re: idea for future builds : toggle menus |
Code: Private Sub picInventory_click()
If picInv.Visible = True Then picInv.Visible = False Else picInv.Visible = True End If End Sub |
Author: | Poyzin [ Mon Aug 18, 2008 12:27 am ] |
Post subject: | Re: idea for future builds : toggle menus |
Anthony wrote: Code: Private Sub picInventory_click() If picInv.Visible = True Then picInv.Visible = False Else picInv.Visible = True End If End Sub See? |
Author: | Jacob [ Mon Aug 18, 2008 1:24 am ] |
Post subject: | Re: idea for future builds : toggle menus |
Anthony wrote: Code: Private Sub picInventory_click() If picInv.Visible = True Then picInv.Visible = False Else picInv.Visible = True End If End Sub Or Code: Private Sub picInventory_click()
picInv.Visible = not picinv.visible End Sub |
Author: | Robin [ Mon Aug 18, 2008 12:02 pm ] |
Post subject: | Re: idea for future builds : toggle menus |
Dugor wins one gold star. |
Author: | Jacob [ Mon Aug 18, 2008 12:09 pm ] |
Post subject: | Re: idea for future builds : toggle menus |
I love Gold Stars. |
Author: | Robin [ Mon Aug 18, 2008 12:13 pm ] |
Post subject: | Re: idea for future builds : toggle menus |
I love you. |
Author: | Poyzin [ Mon Aug 18, 2008 12:35 pm ] |
Post subject: | Re: idea for future builds : toggle menus |
I'm terrified. |
Author: | VersionX [ Thu Aug 21, 2008 2:17 am ] |
Post subject: | Re: idea for future builds : toggle menus |
Dugor wrote: Code: Private Sub picInventory_click() picInv.Visible = not picinv.visible End Sub Is there a better/less-verbose way to toggle the spells, it looks different: Code: Dim spellsVisible as Boolean
Private Sub Form_Load() frmMirage.Width=10080 spellsVisible = false End Sub Private Sub picSpells_Click() If Not spellsVisible Then Call SendData("spells" & END_CHAR) Else Call lblSpellsCancel_Click End If spellsVisible = Not spellsVisible End Sub |
Author: | Anthony [ Thu Aug 21, 2008 2:33 am ] |
Post subject: | Re: idea for future builds : toggle menus |
You shouldn't need to create a boolean. All you need is picSpells.Visible = not picSpells.Visible. Dugors code is just using the opposite of it's value which is already there. You shouldn't have to make anything else. |
Author: | Rian [ Thu Aug 21, 2008 5:45 am ] |
Post subject: | Re: idea for future builds : toggle menus |
No, he's just saying you don't need to code exery little thing. Pictureboxes have a .Visible property which is already like a Boolean variable. Code: Private Sub picSpells_Click()
picPlayerSpells.Visible = not picPlayerSpells.Visible If picPlayerSpells.Visible = True Then CallSendData("spells" & END_CHAR) End If End Sub |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |