SetObject(obj);
int factoryId = type->GetFactoryIdByDecl("MyClass @MyClass()");
SetObject(obj);
int factoryId = type->GetFactoryIdByDecl("MyClass @MyClass()");
asIScriptObject *obj = 0; asIScriptContext *ctx = engine->CreateContext(); ctx->Prepare(factoryFuncId); int r = ctx->Execute(); if( r != asEXECUTION_FINISHED ) { // TODO: What should we do in case of error? } else { obj = *((asIScriptObject**)ctx->GetAddressOfReturnValue()); // Tell AS that we're holding on to the reference obj->AddRef(); } ctx->Release();
int objectTypeId = type->GetTypeId(); asIScriptObject *obj = (asIScriptObject*)engine->CreateScriptObject(objectTypeId);
asIScriptContext *ctx = engine->CreateContext(); ctx->Prepare(type->GetMethodIdByDecl("void func()")); ctx->SetObject(obj); // TODO: Set any other arguments of the method int r = ctx->Execute(); if( r != asEXECUTION_FINISHED ) { // TODO: What should we do in case of error? } ctx->Release();
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game