diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js index 831ef23543..ad25dbf412 100644 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js @@ -2410,6 +2410,16 @@ bool { }, +/** + * @method getSafeAreaRect + * @return {rect_object} + */ +getSafeAreaRect : function ( +) +{ + return cc.Rect; +}, + /** * @method getVR * @return {cc.VRIRenderer} @@ -2771,6 +2781,16 @@ float { }, +/** + * @method getDeltaTime + * @return {float} + */ +getDeltaTime : function ( +) +{ + return 0; +}, + /** * @method getContentScaleFactor * @return {float} @@ -2792,13 +2812,13 @@ getWinSizeInPixels : function ( }, /** - * @method getDeltaTime - * @return {float} + * @method getSafeAreaRect + * @return {rect_object} */ -getDeltaTime : function ( +getSafeAreaRect : function ( ) { - return 0; + return cc.Rect; }, /** diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp index 8069b49b61..8748f959a1 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp @@ -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); 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) { 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("getContentScaleFactor", js_cocos2dx_GLView_getContentScaleFactor, 0, 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("setScissorInPoints", js_cocos2dx_GLView_setScissorInPoints, 4, 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); 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) { 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); 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::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"); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Director_getSafeAreaRect : Invalid Native Object"); if (argc == 0) { - double ret = cobj->getDeltaTime(); + cocos2d::Rect ret = cobj->getSafeAreaRect(); JS::RootedValue jsret(cx); - jsret = DOUBLE_TO_JSVAL(ret); + jsret = ccrect_to_jsval(cx, ret); args.rval().set(jsret); 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; } 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("loadProjectionIdentityMatrix", js_cocos2dx_Director_loadProjectionIdentityMatrix, 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("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("setActionManager", js_cocos2dx_Director_setActionManager, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setAlphaBlending", js_cocos2dx_Director_setAlphaBlending, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp index cec1c160bd..80eb4b3974 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp @@ -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_getContentScaleFactor(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_setScissorInPoints(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_loadProjectionIdentityMatrix(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_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_setActionManager(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Director_setAlphaBlending(JSContext *cx, uint32_t argc, jsval *vp); diff --git a/cocos/scripting/lua-bindings/auto/api/Director.lua b/cocos/scripting/lua-bindings/auto/api/Director.lua index 8cca616d2b..edce04c0af 100644 --- a/cocos/scripting/lua-bindings/auto/api/Director.lua +++ b/cocos/scripting/lua-bindings/auto/api/Director.lua @@ -57,6 +57,12 @@ -- @param #float scaleFactor -- @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.
-- see Director::setContentScaleFactor() @@ -71,10 +77,10 @@ -- @return size_table#size_table ret (return value: size_table) -------------------------------- --- --- @function [parent=#Director] getDeltaTime +-- Returns safe area rectangle of the OpenGL view in points. +-- @function [parent=#Director] getSafeAreaRect -- @param self --- @return float#float ret (return value: float) +-- @return rect_table#rect_table ret (return value: rect_table) -------------------------------- -- Sets the OpenGL default values.
diff --git a/cocos/scripting/lua-bindings/auto/api/GLView.lua b/cocos/scripting/lua-bindings/auto/api/GLView.lua index 37b2f76598..87e1707f68 100644 --- a/cocos/scripting/lua-bindings/auto/api/GLView.lua +++ b/cocos/scripting/lua-bindings/auto/api/GLView.lua @@ -42,6 +42,12 @@ -- @param #bool open -- @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 diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index 181c1e53cb..498481d461 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -12164,6 +12164,53 @@ int lua_cocos2dx_GLView_setIMEKeyboardState(lua_State* tolua_S) 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 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,"getContentScaleFactor",lua_cocos2dx_GLView_getContentScaleFactor); 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,"setScissorInPoints",lua_cocos2dx_GLView_setScissorInPoints); tolua_function(tolua_S,"getViewName",lua_cocos2dx_GLView_getViewName); @@ -13953,6 +14001,53 @@ int lua_cocos2dx_Director_setContentScaleFactor(lua_State* tolua_S) 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 argc = 0; @@ -14047,7 +14142,7 @@ int lua_cocos2dx_Director_getWinSizeInPixels(lua_State* tolua_S) return 0; } -int lua_cocos2dx_Director_getDeltaTime(lua_State* tolua_S) +int lua_cocos2dx_Director_getSafeAreaRect(lua_State* tolua_S) { int argc = 0; cocos2d::Director* cobj = nullptr; @@ -14067,7 +14162,7 @@ int lua_cocos2dx_Director_getDeltaTime(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 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; } #endif @@ -14077,19 +14172,19 @@ int lua_cocos2dx_Director_getDeltaTime(lua_State* tolua_S) { 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; } - double ret = cobj->getDeltaTime(); - tolua_pushnumber(tolua_S,(lua_Number)ret); + 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.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; #if COCOS2D_DEBUG >= 1 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 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,"loadProjectionIdentityMatrix",lua_cocos2dx_Director_loadProjectionIdentityMatrix); 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,"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,"setActionManager",lua_cocos2dx_Director_setActionManager); tolua_function(tolua_S,"setAlphaBlending",lua_cocos2dx_Director_setAlphaBlending); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp index 749b23e0f0..000d8da939 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp @@ -2288,6 +2288,8 @@ int register_all_cocos2dx(lua_State* tolua_S); + +