示例#1
0
static cxInt cxViewLuaSetSize(lua_State *L)
{
    cxInt top = lua_gettop(L);
    CX_LUA_DEF_THIS(cxView);
    cxSize2f size = this->size;
    if(lua_istable(L, 2)){
        size = cxLuaSize2fValue(L, 2, this->size);
    }else if(top == 3){
        size.w = luaL_checknumber(L, 2);
        size.h = luaL_checknumber(L, 3);
    }else{
        luaL_error(L, "args error");
    }
    cxViewSetSize(this, size);
    lua_pushvalue(L, 1);
    return 1;
}
示例#2
0
static cxInt cxEngineLuaSetDesignSize(lua_State *L)
{
    cxEngine this = cxEngineInstance();
    this->dessize = cxLuaSize2fValue(L, 1, this->dessize);
    return 0;
}