GluonEngine::QtScriptComponent Class Reference

#include <qtscriptcomponent.h>

Inheritance diagram for GluonEngine::QtScriptComponent:
GluonEngine::Component GluonCore::GluonObject QObject

List of all members.

Classes

class  QtScriptComponentPrivate

Public Slots

virtual void setScript (GluonEngine::Asset *asset)

Public Member Functions

Q_INVOKABLE QtScriptComponent (QObject *parent=0)
 QtScriptComponent (const QtScriptComponent &other)
virtual ~QtScriptComponent ()
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 ()
virtual Assetscript ()

Properties

GluonEngine::Asset script

Detailed Description

Definition at line 39 of file qtscriptcomponent.h.


Constructor & Destructor Documentation

QtScriptComponent::QtScriptComponent ( QObject parent = 0  ) 

Definition at line 58 of file qtscriptcomponent.cpp.

QtScriptComponent::QtScriptComponent ( const QtScriptComponent other  ) 

Definition at line 67 of file qtscriptcomponent.cpp.

QtScriptComponent::~QtScriptComponent (  )  [virtual]

Definition at line 73 of file qtscriptcomponent.cpp.


Member Function Documentation

QString QtScriptComponent::category (  )  const [virtual]

Return the category of the component. Meta-data used for filtering and sorting components

Reimplemented from GluonEngine::Component.

Definition at line 78 of file qtscriptcomponent.cpp.

void QtScriptComponent::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 175 of file qtscriptcomponent.cpp.

void QtScriptComponent::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.

Parameters:
timeLapse The number of milliseconds passed since the last update
See also:
Game::runGame, update

Reimplemented from GluonEngine::Component.

Definition at line 135 of file qtscriptcomponent.cpp.

void QtScriptComponent::initialize (  )  [virtual]

The initialize function is called whenever an initialized object is needed. This includes scene changes.

Reimplemented from GluonEngine::Component.

Definition at line 83 of file qtscriptcomponent.cpp.

virtual Asset* GluonEngine::QtScriptComponent::script (  )  [virtual]
void QtScriptComponent::setScript ( GluonEngine::Asset asset  )  [virtual, slot]

Definition at line 194 of file qtscriptcomponent.cpp.

void QtScriptComponent::start (  )  [virtual]

The start function is run once after each scene change, immediately before the first update

See also:
Game::setCurrentScene, update

Reimplemented from GluonEngine::Component.

Definition at line 121 of file qtscriptcomponent.cpp.

void QtScriptComponent::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 161 of file qtscriptcomponent.cpp.

void QtScriptComponent::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.

Parameters:
elapsedMilliseconds The amount of time in milliseconds which has passed since the last update
See also:
Game::runGame, draw

Reimplemented from GluonEngine::Component.

Definition at line 148 of file qtscriptcomponent.cpp.


Property Documentation

Asset * QtScriptComponent::script [read, write]

Definition at line 45 of file qtscriptcomponent.h.


The documentation for this class was generated from the following files:
Generated on Mon Dec 27 13:13:43 2010 for Gluon by  doxygen 1.6.3