PDA

View Full Version : How to detect when the editor is opening?



Uhfgood
07-07-2008, 08:56 PM
I've been looking at the low res platformer example. I noticed the function OnOpenEditor -- but I don't know where the heck this is called from.

Anyone tell me how i can tell when the editor opens and closes so I can correctly set my resolutions for both modes?

Seth
07-07-2008, 11:55 PM
OnOpenEditor() and OnCloseEditor() are called by the engine itself, when the editor is opened/closed.

The default functions exist in base/script/system/editor.lua, but if you check RT_LowRest/script/game_start.lua you'll see it has its own versions of them (I just cut and pasted the ones in from editor.lua, and added a few changes), which will automatically override the default versions.