diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js index 190f14f7d5..e605b5b5fd 100644 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js @@ -2443,6 +2443,16 @@ getTextColor : function ( return cc.Color4B; }, +/** + * @method getBlendFunc + * @return {cc.BlendFunc} + */ +getBlendFunc : function ( +) +{ + return cc.BlendFunc; +}, + /** * @method setTextVerticalAlignment * @param {cc.TextVAlignment} arg0 @@ -2683,6 +2693,16 @@ int return cc.Sprite; }, +/** + * @method setBlendFunc + * @param {cc.BlendFunc} arg0 + */ +setBlendFunc : function ( +blendfunc +) +{ +}, + /** * @method getTextVerticalAlignment * @return {cc.TextVAlignment} diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp index 32144fc6a2..6cbb4543de 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp @@ -6195,6 +6195,24 @@ bool js_cocos2dx_ui_Text_getTextColor(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_ui_Text_getTextColor : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_ui_Text_getBlendFunc(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::ui::Text* cobj = (cocos2d::ui::Text *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_Text_getBlendFunc : Invalid Native Object"); + if (argc == 0) { + const cocos2d::BlendFunc& ret = cobj->getBlendFunc(); + JS::RootedValue jsret(cx); + jsret = blendfunc_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_ui_Text_getBlendFunc : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_ui_Text_setTextVerticalAlignment(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -6653,6 +6671,26 @@ bool js_cocos2dx_ui_Text_getLetter(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_ui_Text_getLetter : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_ui_Text_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::ui::Text* cobj = (cocos2d::ui::Text *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ui_Text_setBlendFunc : Invalid Native Object"); + if (argc == 1) { + cocos2d::BlendFunc arg0; + ok &= jsval_to_blendfunc(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Text_setBlendFunc : Error processing arguments"); + cobj->setBlendFunc(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_ui_Text_setBlendFunc : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} bool js_cocos2dx_ui_Text_getTextVerticalAlignment(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -6809,6 +6847,7 @@ void js_register_cocos2dx_ui_Text(JSContext *cx, JS::HandleObject global) { JS_FN("disableEffect", js_cocos2dx_ui_Text_disableEffect, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getLabelEffectType", js_cocos2dx_ui_Text_getLabelEffectType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getTextColor", js_cocos2dx_ui_Text_getTextColor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getBlendFunc", js_cocos2dx_ui_Text_getBlendFunc, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setTextVerticalAlignment", js_cocos2dx_ui_Text_setTextVerticalAlignment, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setFontName", js_cocos2dx_ui_Text_setFontName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setTouchScaleChangeEnabled", js_cocos2dx_ui_Text_setTouchScaleChangeEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -6832,6 +6871,7 @@ void js_register_cocos2dx_ui_Text(JSContext *cx, JS::HandleObject global) { JS_FN("setTextColor", js_cocos2dx_ui_Text_setTextColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("enableGlow", js_cocos2dx_ui_Text_enableGlow, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getLetter", js_cocos2dx_ui_Text_getLetter, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setBlendFunc", js_cocos2dx_ui_Text_setBlendFunc, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getTextVerticalAlignment", js_cocos2dx_ui_Text_getTextVerticalAlignment, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getTextAreaSize", js_cocos2dx_ui_Text_getTextAreaSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setTextHorizontalAlignment", js_cocos2dx_ui_Text_setTextHorizontalAlignment, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp index b180734aa1..d904d5d888 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp @@ -326,6 +326,7 @@ bool js_cocos2dx_ui_Text_getString(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Text_disableEffect(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Text_getLabelEffectType(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Text_getTextColor(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_Text_getBlendFunc(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Text_setTextVerticalAlignment(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Text_setFontName(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Text_setTouchScaleChangeEnabled(JSContext *cx, uint32_t argc, jsval *vp); @@ -349,6 +350,7 @@ bool js_cocos2dx_ui_Text_getShadowColor(JSContext *cx, uint32_t argc, jsval *vp) bool js_cocos2dx_ui_Text_setTextColor(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Text_enableGlow(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Text_getLetter(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ui_Text_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Text_getTextVerticalAlignment(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Text_getTextAreaSize(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Text_setTextHorizontalAlignment(JSContext *cx, uint32_t argc, jsval *vp); diff --git a/cocos/scripting/lua-bindings/auto/api/Text.lua b/cocos/scripting/lua-bindings/auto/api/Text.lua index bf53e0a578..20d29424ed 100644 --- a/cocos/scripting/lua-bindings/auto/api/Text.lua +++ b/cocos/scripting/lua-bindings/auto/api/Text.lua @@ -1,7 +1,7 @@ -------------------------------- -- @module Text --- @extend Widget +-- @extend Widget,BlendProtocol -- @parent_module ccui -------------------------------- @@ -48,6 +48,15 @@ -- @param self -- @return color4b_table#color4b_table ret (return value: color4b_table) +-------------------------------- +-- Returns the blending function that is currently being used.
+-- return A BlendFunc structure with source and destination factor which specified pixel arithmetic.
+-- js NA
+-- lua NA +-- @function [parent=#Text] getBlendFunc +-- @param self +-- @return BlendFunc#BlendFunc ret (return value: cc.BlendFunc) + -------------------------------- -- Sets text vertical alignment.
-- param alignment vertical text alignment type @@ -233,6 +242,16 @@ -- @param #int lettetIndex -- @return Sprite#Sprite ret (return value: cc.Sprite) +-------------------------------- +-- Sets the source blending function.
+-- param blendFunc A structure with source and destination factor to specify pixel arithmetic. e.g. {GL_ONE, GL_ONE}, {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}.
+-- js NA
+-- lua NA +-- @function [parent=#Text] setBlendFunc +-- @param self +-- @param #cc.BlendFunc blendFunc +-- @return Text#Text self (return value: ccui.Text) + -------------------------------- -- Gets text vertical alignment.
-- return Vertical text alignment type diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp index 7f7c8b53cb..980e3a432f 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp @@ -11821,6 +11821,53 @@ int lua_cocos2dx_ui_Text_getTextColor(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_Text_getBlendFunc(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::Text* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.Text",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::Text*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Text_getBlendFunc'", 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_ui_Text_getBlendFunc'", nullptr); + return 0; + } + const cocos2d::BlendFunc& ret = cobj->getBlendFunc(); + blendfunc_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Text:getBlendFunc",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Text_getBlendFunc'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_Text_setTextVerticalAlignment(lua_State* tolua_S) { int argc = 0; @@ -12958,6 +13005,56 @@ int lua_cocos2dx_ui_Text_getLetter(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_Text_setBlendFunc(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::Text* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccui.Text",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::Text*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Text_setBlendFunc'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::BlendFunc arg0; + + ok &= luaval_to_blendfunc(tolua_S, 2, &arg0, "ccui.Text:setBlendFunc"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Text_setBlendFunc'", nullptr); + return 0; + } + cobj->setBlendFunc(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Text:setBlendFunc",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Text_setBlendFunc'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ui_Text_getTextVerticalAlignment(lua_State* tolua_S) { int argc = 0; @@ -13243,6 +13340,7 @@ int lua_register_cocos2dx_ui_Text(lua_State* tolua_S) tolua_function(tolua_S,"disableEffect",lua_cocos2dx_ui_Text_disableEffect); tolua_function(tolua_S,"getLabelEffectType",lua_cocos2dx_ui_Text_getLabelEffectType); tolua_function(tolua_S,"getTextColor",lua_cocos2dx_ui_Text_getTextColor); + tolua_function(tolua_S,"getBlendFunc",lua_cocos2dx_ui_Text_getBlendFunc); tolua_function(tolua_S,"setTextVerticalAlignment",lua_cocos2dx_ui_Text_setTextVerticalAlignment); tolua_function(tolua_S,"setFontName",lua_cocos2dx_ui_Text_setFontName); tolua_function(tolua_S,"setTouchScaleChangeEnabled",lua_cocos2dx_ui_Text_setTouchScaleChangeEnabled); @@ -13266,6 +13364,7 @@ int lua_register_cocos2dx_ui_Text(lua_State* tolua_S) tolua_function(tolua_S,"setTextColor",lua_cocos2dx_ui_Text_setTextColor); tolua_function(tolua_S,"enableGlow",lua_cocos2dx_ui_Text_enableGlow); tolua_function(tolua_S,"getLetter",lua_cocos2dx_ui_Text_getLetter); + tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_ui_Text_setBlendFunc); tolua_function(tolua_S,"getTextVerticalAlignment",lua_cocos2dx_ui_Text_getTextVerticalAlignment); tolua_function(tolua_S,"getTextAreaSize",lua_cocos2dx_ui_Text_getTextAreaSize); tolua_function(tolua_S,"setTextHorizontalAlignment",lua_cocos2dx_ui_Text_setTextHorizontalAlignment); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp index f4423c8034..9460be61f4 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp @@ -792,6 +792,8 @@ int register_all_cocos2dx_ui(lua_State* tolua_S); + +