Hi Guys
I think I've found another virtual button bug, or I do something wrong...
See example explanation
mainwindow1.scene...
add a virtual Button
mainwindow2.scene
add a virtual button
#include "mainmenu.scene"
#include "menu1.scene"
#include "menu2.scene"
mainmenu_setup()
do
if mainmenu_loaded = 1
if GetVirtualButtonPressed(mainmenu_menu2_vb)
DeleteAllObjects() // add this to see if it help, but still receive error
mainmenu_cleanup()
menu2_setup()
elseif GetVirtualButtonPressed(mainmenu_menu3_vb)
DeleteAllObjects() // add this to see if it help, but still receive error
mainmenu_cleanup()
menu3_setup()
elseif GetVirtualButtonPressed(mainmenu_close_vb)
exit
endif
mainmenu_sync()
endif
Print( ScreenFPS() )
Sync()
loop
Going into the "script" I see that all scripts have a
AddVirtualButton(1....., which make sense for the error..
So it looks like the index for virtual buttons don't increase in the new scenes, or the old
deletevirtualbutton(x) don't work
for i = 1 to mainmenu_button.length-1
if GetVirtualButtonExists( mainmenu_button[i] ) then DeleteVirtualButton( mainmenu_button[i] )
next i
Maybe I do something wrong, or don't cleanup everything, but can't seem to figure this out
Please advice