Hi
I'm new to angelscript and I can't do what I want.
I have a c++ struct :
struct float2
{
float x;
float y;
};
I register the object and property :
r = engine->RegisterObjectType("float2", sizeof(float2), asOBJ_VALUE | asOBJ_POD); assert( r >= 0 );
r = engine->RegisterObjectProperty("float2", "float x", asOFFSET(float2,x)); assert( r >= 0 );
r = engine->RegisterObjectProperty("float2", "float y", asOFFSET(float2,y)); assert( r >= 0 );
now in script I would like to declare a global variable of this struct with something like that, but it didn't work :
float2 myPoint = { 0.5f, 0.5f }; // initialize with lists didn't work
how I can init my var at declaration ? Do I need a constructor ?
thanks