check() public static method

public static check ( Lua L, int narg ) : Movie
L Lua
narg int
return LWF.Movie
Example #1
0
    public static int _bind_gotoAndPlay_overload_2(Lua.lua_State L)
    {
        LWF.Movie self    = Luna_LWF_Movie.check(L, 1);
        int       frameNo = (int)Lua.lua_tonumber(L, 2);

        try {
            self.GotoAndPlay(frameNo);
        } catch (Exception e) { Lua.luaL_error(L, new Lua.CharPtr(e.ToString())); }
        return(0);
    }
Example #2
0
    public static int _bind_gotoAndPlay_overload_1(Lua.lua_State L)
    {
        LWF.Movie self  = Luna_LWF_Movie.check(L, 1);
        string    label = Lua.lua_tostring(L, 2).ToString();

        try {
            self.GotoAndPlay(label);
        } catch (Exception e) { Lua.luaL_error(L, new Lua.CharPtr(e.ToString())); }
        return(0);
    }
Example #3
0
 public static int _bind_getParent(Lua.lua_State L)
 {
     if (Lua.lua_gettop(L) != 1 || Luna.get_uniqueid(L, 1) !=
         LunaTraits_LWF_Movie.uniqueID)
     {
         Luna.printStack(L);
         Lua.luaL_error(L, "luna typecheck failed: LWF.Movie.parent");
     }
     LWF.Movie a =
         Luna_LWF_Movie.check(L, 1);
     Luna_LWF_Movie.push(L, a.parent, false);
     return(1);
 }
Example #4
0
 public static int _bind_getBlue(Lua.lua_State L)
 {
     if (Lua.lua_gettop(L) != 1 ||
         Luna.get_uniqueid(L, 1) != 29625181)
     {
         Luna.printStack(L); Lua.luaL_error(L, "luna typecheck failed:getBlue(LWF.Movie self ...)");
     }
     LWF.Movie o = Luna_LWF_Movie.check(L, 1);
     try {
         float ret = getBlue(o);
         Lua.lua_pushnumber(L, ret);
     } catch (Exception e) { Lua.luaL_error(L, new Lua.CharPtr(e.ToString())); }
     return(1);
 }
Example #5
0
    public static int _bind_prevFrame(Lua.lua_State L)
    {
        if (Lua.lua_gettop(L) != 1 ||
            Luna.get_uniqueid(L, 1) != 29625181)
        {
            Luna.printStack(L); Lua.luaL_error(L, "luna typecheck failed:prevFrame(LWF.Movie self)");
        }

        LWF.Movie self = Luna_LWF_Movie.check(L, 1);
        try {
            self.PrevFrame();
        } catch (Exception e) { Lua.luaL_error(L, new Lua.CharPtr(e.ToString())); }
        return(0);
    }
Example #6
0
    public static int __index(Lua.lua_State L)
    {
        if (Lua.lua_gettop(L) == 2 && Luna.get_uniqueid(L, 1) ==
            LunaTraits_LWF_Movie.uniqueID)
        {
            LWF.Movie o =
                Luna_LWF_Movie.check(L, 1);
            string name = Lua.lua_tostring(L, 2).ToString();
            if (o.lwf.GetFieldLua(o, name))
            {
                return(1);
            }
            LWF.Movie movie = o.SearchMovieInstance(name, false);
            if (movie != null)
            {
                Lua.lua_pop(L, 1);
                Luna_LWF_Movie.push(L, movie, false);
                return(1);
            }
            LWF.Button button = o.SearchButtonInstance(name, false);
            if (button != null)
            {
                Lua.lua_pop(L, 1);
                Luna_LWF_Button.push(L, button, false);
                return(1);
            }
        }


        {
            Lua.lua_CFunction fnc = null;
            if (LunaTraits_LWF_Movie.properties.TryGetValue(Lua.lua_tostring(L, 2).ToString(), out fnc))
            {
                Lua.lua_pop(L, 1);                // remove self
                return(fnc(L));
            }
        }

        int mt = Lua.lua_getmetatable(L, 1);

        if (mt == 0)
        {
            Lua.luaL_error(L, "__index");             //end
        }
        Lua.lua_pushstring(L, Lua.lua_tostring(L, 2));
        Lua.lua_rawget(L, -2);
        return(1);
    }
Example #7
0
    public static int _bind_setBlue(Lua.lua_State L)
    {
        if (Lua.lua_gettop(L) != 2 ||
            Luna.get_uniqueid(L, 1) != 29625181 ||
            Lua.lua_isnumber(L, 2) == 0)
        {
            Luna.printStack(L); Lua.luaL_error(L, "luna typecheck failed:setBlue(LWF.Movie self ...)");
        }
        LWF.Movie o = Luna_LWF_Movie.check(L, 1);
        float     v = (float)Lua.lua_tonumber(L, 2);

        try {
            setBlue(o, v);
        } catch (Exception e) { Lua.luaL_error(L, new Lua.CharPtr(e.ToString())); }
        return(0);
    }
Example #8
0
    public static int _bind_setVisible(Lua.lua_State L)
    {
        if (Lua.lua_gettop(L) != 2 ||
            Luna.get_uniqueid(L, 1) != 29625181 ||
            Lua.lua_isboolean(L, 2))
        {
            Luna.printStack(L); Lua.luaL_error(L, "luna typecheck failed:setVisible(LWF.Movie self ...)");
        }
        LWF.Movie o = Luna_LWF_Movie.check(L, 1);
        bool      v = Lua.lua_toboolean(L, 2) != 0;

        try {
            setVisible(o, v);
        } catch (Exception e) { Lua.luaL_error(L, new Lua.CharPtr(e.ToString())); }
        return(0);
    }
Example #9
0
    public static int _bind_gotoFrame(Lua.lua_State L)
    {
        if (Lua.lua_gettop(L) != 2 ||
            Luna.get_uniqueid(L, 1) != 29625181 ||
            Lua.lua_isnumber(L, 2) == 0)
        {
            Luna.printStack(L); Lua.luaL_error(L, "luna typecheck failed:gotoFrame(LWF.Movie self)");
        }

        LWF.Movie self    = Luna_LWF_Movie.check(L, 1);
        int       frameNo = (int)Lua.lua_tonumber(L, 2);

        try {
            self.GotoFrame(frameNo);
        } catch (Exception e) { Lua.luaL_error(L, new Lua.CharPtr(e.ToString())); }
        return(0);
    }
Example #10
0
    public static int _bind_localToGlobal(Lua.lua_State L)
    {
        if (Lua.lua_gettop(L) != 2 ||
            Luna.get_uniqueid(L, 1) != 29625181 ||
            Luna.get_uniqueid(L, 2) != LunaTraits_LWF_Point.uniqueID)
        {
            Luna.printStack(L); Lua.luaL_error(L, "luna typecheck failed:localToGlobal(LWF.Movie self)");
        }

        LWF.Movie self  = Luna_LWF_Movie.check(L, 1);
        LWF.Point point = Luna_LWF_Point.check(L, 2);
        try {
            LWF.Point ret = self.LocalToGlobal(point);
            Luna_LWF_Point.push(L, ret, true, "LWF_Point");
        } catch (Exception e) { Lua.luaL_error(L, new Lua.CharPtr(e.ToString())); }
        return(1);
    }
Example #11
0
    public static int _bind_scaleTo(Lua.lua_State L)
    {
        if (Lua.lua_gettop(L) != 3 ||
            Luna.get_uniqueid(L, 1) != 29625181 ||
            Lua.lua_isnumber(L, 2) == 0 ||
            Lua.lua_isnumber(L, 3) == 0)
        {
            Luna.printStack(L); Lua.luaL_error(L, "luna typecheck failed:scaleTo(LWF.Movie self)");
        }

        LWF.Movie self = Luna_LWF_Movie.check(L, 1);
        float     vx   = (float)Lua.lua_tonumber(L, 2);
        float     vy   = (float)Lua.lua_tonumber(L, 3);

        try {
            self.ScaleTo(vx, vy);
        } catch (Exception e) { Lua.luaL_error(L, new Lua.CharPtr(e.ToString())); }
        return(0);
    }
Example #12
0
    public static int attachMovie(Lua.lua_State L)
    {
        LWF.Movie a;
        int       args = Lua.lua_gettop(L);

        if (args < 3 || args > 6)
        {
            goto error;
        }
        if (Luna.get_uniqueid(L, 1) != LunaTraits_LWF_Movie.uniqueID)
        {
            goto error;
        }
        if (Lua.lua_isstring(L, 2) == 0 || Lua.lua_isstring(L, 3) == 0)
        {
            goto error;
        }
        if (args >= 4 && !Lua.lua_istable(L, 4))
        {
            goto error;
        }
        if (args >= 5 && Lua.lua_isnumber(L, 5) == 0)
        {
            goto error;
        }
        if (args >= 6 && !Lua.lua_isboolean(L, 6))
        {
            goto error;
        }

        a = Luna_LWF_Movie.check(L, 1);
        return(a.lwf.AttachMovieLua(a));

error:
        Luna.printStack(L);
        Lua.luaL_error(L, "luna typecheck failed: LWF.Movie.attachMovie");
        return(1);
    }
Example #13
0
    public static int __newindex(Lua.lua_State L)
    {
        Lua.lua_CFunction fnc = null;
        if (LunaTraits_LWF_Movie.write_properties.TryGetValue(Lua.lua_tostring(L, 2).ToString(), out fnc))
        {
            Lua.lua_insert(L, 2);            // swap key and value
            Lua.lua_settop(L, 2);            // delete key
            return(fnc(L));
        }
        if (Lua.lua_gettop(L) == 3 && Luna.get_uniqueid(L, 1) ==
            LunaTraits_LWF_Movie.uniqueID)
        {
            LWF.Movie o =
                Luna_LWF_Movie.check(L, 1);
            string name = Lua.lua_tostring(L, 2).ToString();
            if (o.lwf.SetFieldLua(o, name))
            {
                return(0);
            }
        }

        Lua.luaL_error(L, "__newindex doesn't allow defining non-property member");
        return(0);
    }