#include <scriptingcomponent.h>
Classes | |
class | ScriptingComponentPrivate |
Public Slots | |
void | setScript (GluonEngine::ScriptingAsset *newAsset) |
void | scriptAssetUpdated () |
QScriptValue | scriptObject () |
Public Member Functions | |
Q_INVOKABLE | ScriptingComponent (QObject *parent=0) |
ScriptingComponent (const ScriptingComponent &other) | |
virtual | ~ScriptingComponent () |
virtual QString | category () const |
virtual void | initialize () |
virtual void | start () |
virtual void | update (int elapsedMilliseconds) |
virtual void | draw (int timeLapse=0) |
virtual void | stop () |
virtual void | cleanup () |
ScriptingAsset * | script () const |
Properties | |
GluonEngine::ScriptingAsset | script |
Definition at line 31 of file scriptingcomponent.h.
ScriptingComponent::ScriptingComponent | ( | QObject * | parent = 0 |
) |
Definition at line 34 of file scriptingcomponent.cpp.
ScriptingComponent::ScriptingComponent | ( | const ScriptingComponent & | other | ) |
Definition at line 40 of file scriptingcomponent.cpp.
ScriptingComponent::~ScriptingComponent | ( | ) | [virtual] |
Definition at line 45 of file scriptingcomponent.cpp.
QString ScriptingComponent::category | ( | ) | const [virtual] |
Return the category of the component. Meta-data used for filtering and sorting components
Reimplemented from GluonEngine::Component.
Definition at line 50 of file scriptingcomponent.cpp.
void ScriptingComponent::cleanup | ( | ) | [virtual] |
The cleanup function is called whenever an object is no longer needed. This happens mostly during scene changes.
Reimplemented from GluonEngine::Component.
Definition at line 179 of file scriptingcomponent.cpp.
void ScriptingComponent::draw | ( | int | timeLapse = 0 |
) | [virtual] |
The draw function is run every time the engine requests a redraw of the screen. Avoid putting any game logic in this function. The optional timeLapse depends on gameloop being used. By default Gluon uses a gameloop which runs update a fixed number of times per second, while draw is called as often as it can be. The timeLapse parameter then tells you how many milliseconds have passed since the last time update was run. This allows you to extrapolate draw positions of items and thus create a potentially smoother gaming experience.
timeLapse | The number of milliseconds passed since the last update
|
Reimplemented from GluonEngine::Component.
Definition at line 151 of file scriptingcomponent.cpp.
void ScriptingComponent::initialize | ( | ) | [virtual] |
The initialize function is called whenever an initialized object is needed. This includes scene changes.
Reimplemented from GluonEngine::Component.
Definition at line 106 of file scriptingcomponent.cpp.
ScriptingAsset* GluonEngine::ScriptingComponent::script | ( | ) | const |
void ScriptingComponent::scriptAssetUpdated | ( | ) | [slot] |
Definition at line 95 of file scriptingcomponent.cpp.
QScriptValue ScriptingComponent::scriptObject | ( | ) | [slot] |
Definition at line 101 of file scriptingcomponent.cpp.
void ScriptingComponent::setScript | ( | GluonEngine::ScriptingAsset * | newAsset | ) | [slot] |
Definition at line 60 of file scriptingcomponent.cpp.
void ScriptingComponent::start | ( | ) | [virtual] |
The start function is run once after each scene change, immediately before the first update
Reimplemented from GluonEngine::Component.
Definition at line 123 of file scriptingcomponent.cpp.
void ScriptingComponent::stop | ( | ) | [virtual] |
The stop function is run once when the gameloop is stopped. Use it for removing temporary data between runs. Reimplement this function if you have something that needs cleaning up between runs.
Reimplemented from GluonEngine::Component.
Definition at line 165 of file scriptingcomponent.cpp.
void ScriptingComponent::update | ( | int | elapsedMilliseconds | ) | [virtual] |
The update function is run each time the game logic needs to be updated. Implement this function in inherited classed to allow for updates along with the rest of the GameObject hierarchy. Note that this is only for updating the game logic - any drawing functionality should be put into the draw function.
elapsedMilliseconds | The amount of time in milliseconds which has passed since the last update
|
Reimplemented from GluonEngine::Component.
Definition at line 137 of file scriptingcomponent.cpp.
ScriptingAsset * ScriptingComponent::script [read, write] |
Definition at line 37 of file scriptingcomponent.h.