[ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18494)

This commit is contained in:
CocosRobot 2017-11-23 16:06:18 +08:00 committed by James Chen
parent e890cfa6be
commit 3ffc1e8644
7 changed files with 192 additions and 22 deletions

View File

@ -2410,6 +2410,16 @@ bool
{ {
}, },
/**
* @method getSafeAreaRect
* @return {rect_object}
*/
getSafeAreaRect : function (
)
{
return cc.Rect;
},
/** /**
* @method getVR * @method getVR
* @return {cc.VRIRenderer} * @return {cc.VRIRenderer}
@ -2771,6 +2781,16 @@ float
{ {
}, },
/**
* @method getDeltaTime
* @return {float}
*/
getDeltaTime : function (
)
{
return 0;
},
/** /**
* @method getContentScaleFactor * @method getContentScaleFactor
* @return {float} * @return {float}
@ -2792,13 +2812,13 @@ getWinSizeInPixels : function (
}, },
/** /**
* @method getDeltaTime * @method getSafeAreaRect
* @return {float} * @return {rect_object}
*/ */
getDeltaTime : function ( getSafeAreaRect : function (
) )
{ {
return 0; return cc.Rect;
}, },
/** /**

View File

@ -6085,6 +6085,24 @@ bool js_cocos2dx_GLView_setIMEKeyboardState(JSContext *cx, uint32_t argc, jsval
JS_ReportError(cx, "js_cocos2dx_GLView_setIMEKeyboardState : wrong number of arguments: %d, was expecting %d", argc, 1); JS_ReportError(cx, "js_cocos2dx_GLView_setIMEKeyboardState : wrong number of arguments: %d, was expecting %d", argc, 1);
return false; return false;
} }
bool js_cocos2dx_GLView_getSafeAreaRect(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
js_proxy_t *proxy = jsb_get_js_proxy(obj);
cocos2d::GLView* cobj = (cocos2d::GLView *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLView_getSafeAreaRect : Invalid Native Object");
if (argc == 0) {
cocos2d::Rect ret = cobj->getSafeAreaRect();
JS::RootedValue jsret(cx);
jsret = ccrect_to_jsval(cx, ret);
args.rval().set(jsret);
return true;
}
JS_ReportError(cx, "js_cocos2dx_GLView_getSafeAreaRect : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_GLView_getVR(JSContext *cx, uint32_t argc, jsval *vp) bool js_cocos2dx_GLView_getVR(JSContext *cx, uint32_t argc, jsval *vp)
{ {
JS::CallArgs args = JS::CallArgsFromVp(argc, vp); JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
@ -6668,6 +6686,7 @@ void js_register_cocos2dx_GLView(JSContext *cx, JS::HandleObject global) {
JS_FN("setContentScaleFactor", js_cocos2dx_GLView_setContentScaleFactor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setContentScaleFactor", js_cocos2dx_GLView_setContentScaleFactor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getContentScaleFactor", js_cocos2dx_GLView_getContentScaleFactor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getContentScaleFactor", js_cocos2dx_GLView_getContentScaleFactor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("setIMEKeyboardState", js_cocos2dx_GLView_setIMEKeyboardState, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setIMEKeyboardState", js_cocos2dx_GLView_setIMEKeyboardState, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getSafeAreaRect", js_cocos2dx_GLView_getSafeAreaRect, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getVR", js_cocos2dx_GLView_getVR, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getVR", js_cocos2dx_GLView_getVR, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("setScissorInPoints", js_cocos2dx_GLView_setScissorInPoints, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setScissorInPoints", js_cocos2dx_GLView_setScissorInPoints, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getViewName", js_cocos2dx_GLView_getViewName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getViewName", js_cocos2dx_GLView_getViewName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
@ -6849,6 +6868,24 @@ bool js_cocos2dx_Director_setContentScaleFactor(JSContext *cx, uint32_t argc, js
JS_ReportError(cx, "js_cocos2dx_Director_setContentScaleFactor : wrong number of arguments: %d, was expecting %d", argc, 1); JS_ReportError(cx, "js_cocos2dx_Director_setContentScaleFactor : wrong number of arguments: %d, was expecting %d", argc, 1);
return false; return false;
} }
bool js_cocos2dx_Director_getDeltaTime(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
js_proxy_t *proxy = jsb_get_js_proxy(obj);
cocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Director_getDeltaTime : Invalid Native Object");
if (argc == 0) {
double ret = cobj->getDeltaTime();
JS::RootedValue jsret(cx);
jsret = DOUBLE_TO_JSVAL(ret);
args.rval().set(jsret);
return true;
}
JS_ReportError(cx, "js_cocos2dx_Director_getDeltaTime : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_Director_getContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp) bool js_cocos2dx_Director_getContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp)
{ {
JS::CallArgs args = JS::CallArgsFromVp(argc, vp); JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
@ -6885,22 +6922,22 @@ bool js_cocos2dx_Director_getWinSizeInPixels(JSContext *cx, uint32_t argc, jsval
JS_ReportError(cx, "js_cocos2dx_Director_getWinSizeInPixels : wrong number of arguments: %d, was expecting %d", argc, 0); JS_ReportError(cx, "js_cocos2dx_Director_getWinSizeInPixels : wrong number of arguments: %d, was expecting %d", argc, 0);
return false; return false;
} }
bool js_cocos2dx_Director_getDeltaTime(JSContext *cx, uint32_t argc, jsval *vp) bool js_cocos2dx_Director_getSafeAreaRect(JSContext *cx, uint32_t argc, jsval *vp)
{ {
JS::CallArgs args = JS::CallArgsFromVp(argc, vp); JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
js_proxy_t *proxy = jsb_get_js_proxy(obj); js_proxy_t *proxy = jsb_get_js_proxy(obj);
cocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL); cocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Director_getDeltaTime : Invalid Native Object"); JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Director_getSafeAreaRect : Invalid Native Object");
if (argc == 0) { if (argc == 0) {
double ret = cobj->getDeltaTime(); cocos2d::Rect ret = cobj->getSafeAreaRect();
JS::RootedValue jsret(cx); JS::RootedValue jsret(cx);
jsret = DOUBLE_TO_JSVAL(ret); jsret = ccrect_to_jsval(cx, ret);
args.rval().set(jsret); args.rval().set(jsret);
return true; return true;
} }
JS_ReportError(cx, "js_cocos2dx_Director_getDeltaTime : wrong number of arguments: %d, was expecting %d", argc, 0); JS_ReportError(cx, "js_cocos2dx_Director_getSafeAreaRect : wrong number of arguments: %d, was expecting %d", argc, 0);
return false; return false;
} }
bool js_cocos2dx_Director_setGLDefaultValues(JSContext *cx, uint32_t argc, jsval *vp) bool js_cocos2dx_Director_setGLDefaultValues(JSContext *cx, uint32_t argc, jsval *vp)
@ -8179,9 +8216,10 @@ void js_register_cocos2dx_Director(JSContext *cx, JS::HandleObject global) {
JS_FN("setEventDispatcher", js_cocos2dx_Director_setEventDispatcher, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setEventDispatcher", js_cocos2dx_Director_setEventDispatcher, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("loadProjectionIdentityMatrix", js_cocos2dx_Director_loadProjectionIdentityMatrix, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("loadProjectionIdentityMatrix", js_cocos2dx_Director_loadProjectionIdentityMatrix, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("setContentScaleFactor", js_cocos2dx_Director_setContentScaleFactor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setContentScaleFactor", js_cocos2dx_Director_setContentScaleFactor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getDeltaTime", js_cocos2dx_Director_getDeltaTime, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getContentScaleFactor", js_cocos2dx_Director_getContentScaleFactor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getContentScaleFactor", js_cocos2dx_Director_getContentScaleFactor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getWinSizeInPixels", js_cocos2dx_Director_getWinSizeInPixels, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getWinSizeInPixels", js_cocos2dx_Director_getWinSizeInPixels, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getDeltaTime", js_cocos2dx_Director_getDeltaTime, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getSafeAreaRect", js_cocos2dx_Director_getSafeAreaRect, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("setGLDefaultValues", js_cocos2dx_Director_setGLDefaultValues, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setGLDefaultValues", js_cocos2dx_Director_setGLDefaultValues, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("setActionManager", js_cocos2dx_Director_setActionManager, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setActionManager", js_cocos2dx_Director_setActionManager, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("setAlphaBlending", js_cocos2dx_Director_setAlphaBlending, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setAlphaBlending", js_cocos2dx_Director_setAlphaBlending, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),

View File

@ -309,6 +309,7 @@ bool js_cocos2dx_GLView_getViewPortRect(JSContext *cx, uint32_t argc, jsval *vp)
bool js_cocos2dx_GLView_setContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_setContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_getContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_getContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_setIMEKeyboardState(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_setIMEKeyboardState(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_getSafeAreaRect(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_getVR(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_getVR(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_setScissorInPoints(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_setScissorInPoints(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_GLView_getViewName(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_GLView_getViewName(JSContext *cx, uint32_t argc, jsval *vp);
@ -351,9 +352,10 @@ bool js_cocos2dx_Director_popProjectionMatrix(JSContext *cx, uint32_t argc, jsva
bool js_cocos2dx_Director_setEventDispatcher(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_setEventDispatcher(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Director_loadProjectionIdentityMatrix(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_loadProjectionIdentityMatrix(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Director_setContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_setContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Director_getDeltaTime(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Director_getContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_getContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Director_getWinSizeInPixels(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_getWinSizeInPixels(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Director_getDeltaTime(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_getSafeAreaRect(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Director_setGLDefaultValues(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_setGLDefaultValues(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Director_setActionManager(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_setActionManager(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Director_setAlphaBlending(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_setAlphaBlending(JSContext *cx, uint32_t argc, jsval *vp);

View File

@ -57,6 +57,12 @@
-- @param #float scaleFactor -- @param #float scaleFactor
-- @return Director#Director self (return value: cc.Director) -- @return Director#Director self (return value: cc.Director)
--------------------------------
--
-- @function [parent=#Director] getDeltaTime
-- @param self
-- @return float#float ret (return value: float)
-------------------------------- --------------------------------
-- Gets content scale factor.<br> -- Gets content scale factor.<br>
-- see Director::setContentScaleFactor() -- see Director::setContentScaleFactor()
@ -71,10 +77,10 @@
-- @return size_table#size_table ret (return value: size_table) -- @return size_table#size_table ret (return value: size_table)
-------------------------------- --------------------------------
-- -- Returns safe area rectangle of the OpenGL view in points.
-- @function [parent=#Director] getDeltaTime -- @function [parent=#Director] getSafeAreaRect
-- @param self -- @param self
-- @return float#float ret (return value: float) -- @return rect_table#rect_table ret (return value: rect_table)
-------------------------------- --------------------------------
-- Sets the OpenGL default values.<br> -- Sets the OpenGL default values.<br>

View File

@ -42,6 +42,12 @@
-- @param #bool open -- @param #bool open
-- @return GLView#GLView self (return value: cc.GLView) -- @return GLView#GLView self (return value: cc.GLView)
--------------------------------
-- Gets safe area rectangle
-- @function [parent=#GLView] getSafeAreaRect
-- @param self
-- @return rect_table#rect_table ret (return value: rect_table)
-------------------------------- --------------------------------
-- --
-- @function [parent=#GLView] getVR -- @function [parent=#GLView] getVR

View File

@ -12164,6 +12164,53 @@ int lua_cocos2dx_GLView_setIMEKeyboardState(lua_State* tolua_S)
return 0; return 0;
} }
int lua_cocos2dx_GLView_getSafeAreaRect(lua_State* tolua_S)
{
int argc = 0;
cocos2d::GLView* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.GLView",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::GLView*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLView_getSafeAreaRect'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLView_getSafeAreaRect'", nullptr);
return 0;
}
cocos2d::Rect ret = cobj->getSafeAreaRect();
rect_to_luaval(tolua_S, ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLView:getSafeAreaRect",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLView_getSafeAreaRect'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_GLView_getVR(lua_State* tolua_S) int lua_cocos2dx_GLView_getVR(lua_State* tolua_S)
{ {
int argc = 0; int argc = 0;
@ -13619,6 +13666,7 @@ int lua_register_cocos2dx_GLView(lua_State* tolua_S)
tolua_function(tolua_S,"setContentScaleFactor",lua_cocos2dx_GLView_setContentScaleFactor); tolua_function(tolua_S,"setContentScaleFactor",lua_cocos2dx_GLView_setContentScaleFactor);
tolua_function(tolua_S,"getContentScaleFactor",lua_cocos2dx_GLView_getContentScaleFactor); tolua_function(tolua_S,"getContentScaleFactor",lua_cocos2dx_GLView_getContentScaleFactor);
tolua_function(tolua_S,"setIMEKeyboardState",lua_cocos2dx_GLView_setIMEKeyboardState); tolua_function(tolua_S,"setIMEKeyboardState",lua_cocos2dx_GLView_setIMEKeyboardState);
tolua_function(tolua_S,"getSafeAreaRect",lua_cocos2dx_GLView_getSafeAreaRect);
tolua_function(tolua_S,"getVR",lua_cocos2dx_GLView_getVR); tolua_function(tolua_S,"getVR",lua_cocos2dx_GLView_getVR);
tolua_function(tolua_S,"setScissorInPoints",lua_cocos2dx_GLView_setScissorInPoints); tolua_function(tolua_S,"setScissorInPoints",lua_cocos2dx_GLView_setScissorInPoints);
tolua_function(tolua_S,"getViewName",lua_cocos2dx_GLView_getViewName); tolua_function(tolua_S,"getViewName",lua_cocos2dx_GLView_getViewName);
@ -13953,6 +14001,53 @@ int lua_cocos2dx_Director_setContentScaleFactor(lua_State* tolua_S)
return 0; return 0;
} }
int lua_cocos2dx_Director_getDeltaTime(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Director* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.Director",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_getDeltaTime'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Director_getDeltaTime'", nullptr);
return 0;
}
double ret = cobj->getDeltaTime();
tolua_pushnumber(tolua_S,(lua_Number)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:getDeltaTime",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_getDeltaTime'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Director_getContentScaleFactor(lua_State* tolua_S) int lua_cocos2dx_Director_getContentScaleFactor(lua_State* tolua_S)
{ {
int argc = 0; int argc = 0;
@ -14047,7 +14142,7 @@ int lua_cocos2dx_Director_getWinSizeInPixels(lua_State* tolua_S)
return 0; return 0;
} }
int lua_cocos2dx_Director_getDeltaTime(lua_State* tolua_S) int lua_cocos2dx_Director_getSafeAreaRect(lua_State* tolua_S)
{ {
int argc = 0; int argc = 0;
cocos2d::Director* cobj = nullptr; cocos2d::Director* cobj = nullptr;
@ -14067,7 +14162,7 @@ int lua_cocos2dx_Director_getDeltaTime(lua_State* tolua_S)
#if COCOS2D_DEBUG >= 1 #if COCOS2D_DEBUG >= 1
if (!cobj) if (!cobj)
{ {
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_getDeltaTime'", nullptr); tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_getSafeAreaRect'", nullptr);
return 0; return 0;
} }
#endif #endif
@ -14077,19 +14172,19 @@ int lua_cocos2dx_Director_getDeltaTime(lua_State* tolua_S)
{ {
if(!ok) if(!ok)
{ {
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Director_getDeltaTime'", nullptr); tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Director_getSafeAreaRect'", nullptr);
return 0; return 0;
} }
double ret = cobj->getDeltaTime(); cocos2d::Rect ret = cobj->getSafeAreaRect();
tolua_pushnumber(tolua_S,(lua_Number)ret); rect_to_luaval(tolua_S, ret);
return 1; return 1;
} }
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:getDeltaTime",argc, 0); luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:getSafeAreaRect",argc, 0);
return 0; return 0;
#if COCOS2D_DEBUG >= 1 #if COCOS2D_DEBUG >= 1
tolua_lerror: tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_getDeltaTime'.",&tolua_err); tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Director_getSafeAreaRect'.",&tolua_err);
#endif #endif
return 0; return 0;
@ -17154,9 +17249,10 @@ int lua_register_cocos2dx_Director(lua_State* tolua_S)
tolua_function(tolua_S,"setEventDispatcher",lua_cocos2dx_Director_setEventDispatcher); tolua_function(tolua_S,"setEventDispatcher",lua_cocos2dx_Director_setEventDispatcher);
tolua_function(tolua_S,"loadProjectionIdentityMatrix",lua_cocos2dx_Director_loadProjectionIdentityMatrix); tolua_function(tolua_S,"loadProjectionIdentityMatrix",lua_cocos2dx_Director_loadProjectionIdentityMatrix);
tolua_function(tolua_S,"setContentScaleFactor",lua_cocos2dx_Director_setContentScaleFactor); tolua_function(tolua_S,"setContentScaleFactor",lua_cocos2dx_Director_setContentScaleFactor);
tolua_function(tolua_S,"getDeltaTime",lua_cocos2dx_Director_getDeltaTime);
tolua_function(tolua_S,"getContentScaleFactor",lua_cocos2dx_Director_getContentScaleFactor); tolua_function(tolua_S,"getContentScaleFactor",lua_cocos2dx_Director_getContentScaleFactor);
tolua_function(tolua_S,"getWinSizeInPixels",lua_cocos2dx_Director_getWinSizeInPixels); tolua_function(tolua_S,"getWinSizeInPixels",lua_cocos2dx_Director_getWinSizeInPixels);
tolua_function(tolua_S,"getDeltaTime",lua_cocos2dx_Director_getDeltaTime); tolua_function(tolua_S,"getSafeAreaRect",lua_cocos2dx_Director_getSafeAreaRect);
tolua_function(tolua_S,"setGLDefaultValues",lua_cocos2dx_Director_setGLDefaultValues); tolua_function(tolua_S,"setGLDefaultValues",lua_cocos2dx_Director_setGLDefaultValues);
tolua_function(tolua_S,"setActionManager",lua_cocos2dx_Director_setActionManager); tolua_function(tolua_S,"setActionManager",lua_cocos2dx_Director_setActionManager);
tolua_function(tolua_S,"setAlphaBlending",lua_cocos2dx_Director_setAlphaBlending); tolua_function(tolua_S,"setAlphaBlending",lua_cocos2dx_Director_setAlphaBlending);

View File

@ -2288,6 +2288,8 @@ int register_all_cocos2dx(lua_State* tolua_S);