Exemple #1
0
QScriptValue TypedArray::newInstance(quint32 length) {
    ArrayBufferClass* array = getScriptEngine()->getArrayBufferClass();
    QScriptValue buffer = array->newInstance(length * _bytesPerElement);
    return newInstance(buffer, 0, length);
}
void State::onExit()
{
	if(_onExitFunction)
		getScriptEngine()->runFunction(_onExitFunction, "object", _owner);
};
void State::setOnExitScriptFunction(std::string code)
{
	_onExitCode = code;
	_onExitFunction = getScriptEngine()->compileFunction("State", code.c_str(), 0, asCOMP_ADD_TO_MODULE);
}
void State::onUpdate(float deltaTime)
{
	if(_onUpdateFunction)
		getScriptEngine()->runFunction(_onUpdateFunction, "object", _owner);
};