Lua/C# noob

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Lua/C# noob

Jonas Beckeman
Hello all,

Just joined the list in hope of getting a better understanding of how to add
Lua scripting to my open-source C# game development kit project:
http://www.codeproject.com/csharp/Endogine.asp

Most of it works fine, I've got the WinForms example up and running, and
have succeeded in my first simple attempts to control the game engine.
However, I have a problem with one of my imported types.

I import two types, which are very similar in their design. One of them
works, the other doesn't, and I just can't understand why.

EPointF = luanet.import_type("Endogine.EPointF");
ERectangleF = luanet.import_type("Endogine.ERectangleF");

rct = ERectangleF(0,0, 1,1)
rct.X = 2

pt = EPoint(1,1)
pt.X = 1 --This fails! =nil!

Any help would be much appreciated. Thanks!

/Jonas


Reply | Threaded
Open this post in threaded view
|

Re: Lua/C# noob

Zachary P. Landau-4
> I import two types, which are very similar in their design. One of them
> works, the other doesn't, and I just can't understand why.
>
> EPointF = luanet.import_type("Endogine.EPointF");
> ERectangleF = luanet.import_type("Endogine.ERectangleF");
>
> rct = ERectangleF(0,0, 1,1)
> rct.X = 2
>
> pt = EPoint(1,1)
> pt.X = 1 --This fails! =nil!

Did you directly cut and paste this?  Because you create EPointF above
but then try to call EPoint (without the F).

--
Zachary P. Landau <[hidden email]>


Reply | Threaded
Open this post in threaded view
|

RE: Lua/C# noob

Jonas Beckeman
> Did you directly cut and paste this?  Because you create EPointF above
> but then try to call EPoint (without the F).

Sorry, I wrote it manually and forgot the F. Stupid of me... Actually, I
import both EPoint and EPointF.

/Jonas