diff --git a/cocos/scripting/lua-bindings/script/cocos2d/DrawPrimitives.lua b/cocos/scripting/lua-bindings/script/cocos2d/DrawPrimitives.lua index 5d594cf9df..e4f50a93ff 100644 --- a/cocos/scripting/lua-bindings/script/cocos2d/DrawPrimitives.lua +++ b/cocos/scripting/lua-bindings/script/cocos2d/DrawPrimitives.lua @@ -8,11 +8,11 @@ local dp_pointSize = 1.0 local SHADER_NAME_POSITION_U_COLOR = "ShaderPosition_uColor" -local targetPlatform = CCApplication:getInstance():getTargetPlatform() +local targetPlatform = cc.Application:getInstance():getTargetPlatform() local function lazy_init() if not dp_initialized then - dp_shader = CCShaderCache:getInstance():getProgram(SHADER_NAME_POSITION_U_COLOR) + dp_shader = cc.ShaderCache:getInstance():getProgram(SHADER_NAME_POSITION_U_COLOR) --dp_shader:retain() if nil ~= dp_shader then dp_colorLocation = gl.getUniformLocation( dp_shader:getProgram(), "u_color") @@ -52,7 +52,7 @@ function ccDrawColor4f(r,g,b,a) end function ccPointSize(pointSize) - dp_pointSize = pointSize * CCDirector:getInstance():getContentScaleFactor() + dp_pointSize = pointSize * cc.Director:getInstance():getContentScaleFactor() end function ccDrawColor4B(r,g,b,a) diff --git a/cocos/scripting/lua-bindings/script/init.lua b/cocos/scripting/lua-bindings/script/init.lua index 4e2621b0dd..3307f40bc0 100644 --- a/cocos/scripting/lua-bindings/script/init.lua +++ b/cocos/scripting/lua-bindings/script/init.lua @@ -3,6 +3,7 @@ require "cocos.cocos2d.Cocos2d" require "cocos.cocos2d.Cocos2dConstants" require "cocos.cocos2d.extern" require "cocos.cocos2d.bitExtend" +require "cocos.cocos2d.DrawPrimitives" -- opengl require "cocos.cocos2d.Opengl" @@ -27,11 +28,15 @@ require "cocos.extension.ExtensionConstants" -- network require "cocos.network.NetworkConstants" +-- Spine +require "cocos.spine.SpineConstants" + if CC_USE_DEPRECATED_API then -- CCLuaEngine require "cocos.cocos2d.DeprecatedCocos2dClass" require "cocos.cocos2d.DeprecatedCocos2dEnum" require "cocos.cocos2d.DeprecatedCocos2dFunc" + require "cocos.cocos2d.DeprecatedOpenglEnum" -- register_cocostudio_module require "cocos.cocostudio.DeprecatedCocoStudioClass" diff --git a/tests/lua-tests/src/LabelTestNew/LabelTestNew.lua b/tests/lua-tests/src/LabelTestNew/LabelTestNew.lua index 71e084361e..a5f2706cd1 100644 --- a/tests/lua-tests/src/LabelTestNew/LabelTestNew.lua +++ b/tests/lua-tests/src/LabelTestNew/LabelTestNew.lua @@ -1278,8 +1278,8 @@ local LabelCrashTest = {} function LabelCrashTest.create() local layer = cc.Layer:create() Helper.initWithLayer(layer) - Helper.titleLabel:setString("New Label + .TTF") - Helper.subtitleLabel:setString("Testing rendering base on DistanceField") + Helper.titleLabel:setString("New Label Crash Test") + Helper.subtitleLabel:setString("Not crash and show [Test123] when using unknown character.") local ttfConfig = {} ttfConfig.fontFilePath = "fonts/arial.ttf"