The example below will open the splash window and put it on top of the main program window. But the graphics are not drawn until it reaches the waitevent in the main loop, so obviously this is not the way to do it.
But where to put the command to close the window to make it work?
I tried removing the Wait() command, and using a timer instead and let it be called later from p_Eventfunc. But WaitEvent does not call the function until a GUI event is detected.
Another thing. Window.Borderless will only work for Android/Amiga? How to open a borderless window on windows?
Code: Select all
InstallEventHandler({RapaGUI = p_EventFunc})
moai.CreateObject([[
<window id="splash" Borderless="True" title="Splash Window">
<vgroup>
<image brush="2"/>
</vgroup>
</window>
]])
moai.DoMethod("app", "addwindow", "splash")
moai.Set("splash", "open", True)
Wait(150)
moai.Set("splash", "open", False)
Repeat
WaitEvent
Forever