PixelLightAPI
.
|
Script application class. More...
#include <ScriptApplication.h>
Public Member Functions | |
PL_API | ScriptApplication (PLCore::Frontend &cFrontend) |
Constructor. | |
PL_API | ScriptApplication (PLCore::Frontend &cFrontend, PLCore::String sScriptFilename) |
Constructor for loading in and executing a scripted stand-alone application using just a single line of C++ code. | |
PL_API | ScriptApplication (PLCore::Frontend &cFrontend, PLCore::String sScriptFilename, PLCore::String sName, PLCore::String sTitle, PLCore::String sAppDataSubdir) |
Constructor for loading in and executing a scripted stand-alone application using just a single line of C++ code. | |
virtual PL_API | ~ScriptApplication () |
Destructor. | |
PL_API PLCore::String | GetBaseDirectory () const |
Returns the base directory of the application. | |
PL_API void | SetBaseDirectory (const PLCore::String &sBaseDirectory) |
Sets the base directory of the application. | |
Protected Member Functions | |
virtual PL_API bool | OnStart () override |
Initialization function that is called prior to OnInit() | |
virtual PL_API void | OnStop () override |
De-initialization function that is called after OnDeInit() | |
virtual PL_API void | OnUpdate () override |
Called to let the frontend update it's states. | |
PL_API bool | LoadScript (const PLCore::String &sFilename) |
Loads a script. | |
PL_API void | DestroyScript () |
Destroys the currently used script. | |
Protected Attributes | |
PLCore::String | m_sCurrentSceneBaseDirectory |
PLCore::String | m_sScriptFilename |
PLCore::Script * | m_pScript |
Script application class.
PL_API PLEngine::ScriptApplication::ScriptApplication | ( | PLCore::Frontend & | cFrontend | ) |
Constructor.
[in] | cFrontend | Frontend this application instance is running in |
PL_API PLEngine::ScriptApplication::ScriptApplication | ( | PLCore::Frontend & | cFrontend, |
PLCore::String | sScriptFilename | ||
) |
Constructor for loading in and executing a scripted stand-alone application using just a single line of C++ code.
[in] | cFrontend | Frontend this application instance is running in |
[in] | sScriptFilename | Filename of the script to load |
* Usage example: * int PLMain(const String &sExecutableFilename, const Array<String> &lstArguments) * { * return ScriptApplication("Data/Scripts/45ScriptApplication.lua").Run(sExecutableFilename, lstArguments); * } *
PL_API PLEngine::ScriptApplication::ScriptApplication | ( | PLCore::Frontend & | cFrontend, |
PLCore::String | sScriptFilename, | ||
PLCore::String | sName, | ||
PLCore::String | sTitle, | ||
PLCore::String | sAppDataSubdir | ||
) |
Constructor for loading in and executing a scripted stand-alone application using just a single line of C++ code.
[in] | cFrontend | Frontend this application instance is running in |
[in] | sScriptFilename | Filename of the script to load |
[in] | sName | Optional name of the application, if empty string a name is constructed automatically by using the filename of the script |
[in] | sTitle | Optional title of the application, if empty string a title is constructed automatically by using the filename of the script |
[in] | sAppDataSubdir | Optional subdirectory for application data files, if empty string a directory is constructed automatically by using the filename of the script |
* Usage example: * int PLMain(const String &sExecutableFilename, const Array<String> &lstArguments) * { * return ScriptApplication("Data/Scripts/45ScriptApplication.lua").Run(sExecutableFilename, lstArguments); * } *
virtual PL_API PLEngine::ScriptApplication::~ScriptApplication | ( | ) | [virtual] |
Destructor.
PL_API PLCore::String PLEngine::ScriptApplication::GetBaseDirectory | ( | ) | const |
Returns the base directory of the application.
PL_API void PLEngine::ScriptApplication::SetBaseDirectory | ( | const PLCore::String & | sBaseDirectory | ) |
Sets the base directory of the application.
[in] | sBaseDirectory | The base directory of the application |
virtual PL_API bool PLEngine::ScriptApplication::OnStart | ( | ) | [override, protected, virtual] |
Initialization function that is called prior to OnInit()
Reimplemented from PLEngine::EngineApplication.
virtual PL_API void PLEngine::ScriptApplication::OnStop | ( | ) | [override, protected, virtual] |
De-initialization function that is called after OnDeInit()
Reimplemented from PLEngine::EngineApplication.
virtual PL_API void PLEngine::ScriptApplication::OnUpdate | ( | ) | [override, protected, virtual] |
Called to let the frontend update it's states.
Reimplemented from PLEngine::EngineApplication.
PL_API bool PLEngine::ScriptApplication::LoadScript | ( | const PLCore::String & | sFilename | ) | [protected] |
Loads a script.
[in] | sFilename | Filename of the script to load |
PL_API void PLEngine::ScriptApplication::DestroyScript | ( | ) | [protected] |
Destroys the currently used script.
Base directory of the currently loaded scene
Filename of the used script
PLCore::Script* PLEngine::ScriptApplication::m_pScript [protected] |
Used script instance, can be a null pointer
|