lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


You'll want to make a userdata for your Sprite struct.  There are many
ways to do this.  Some examples can be found here:
http://lua-users.org/wiki/SampleCode .

wes

On 7/24/07, L-28C <kixdemp@gmail.com> wrote:
Hello everyone!

I have this:

--------------------
struct Sprite
{
        BITMAP *sheet, *img;
        int pos, xdir, ydir, anim, walking,
                x, y, sheetX, sheetY;
};

struct Sprite *loadSprite(const char*);
--------------------

How would I pass the Sprite struct over to Lua so that it can call
loadSprite?

I can't have all of my sprites hardcoded on C because, well, there are many.

Thanks in advance, everyone!