From 89981bc0806c8293299370eba725d545cb321d0a Mon Sep 17 00:00:00 2001 From: tkzcfc Date: Mon, 27 Feb 2023 19:12:21 +0800 Subject: [PATCH] fix: type judgment error (#1084) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: type judgment error --------- Co-authored-by: tkzcfc Co-authored-by: 一线灵|Deal Co-authored-by: HYGK-PC\Administrator --- .../scripting/lua-bindings/script/framework/display.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/scripting/lua-bindings/script/framework/display.lua b/extensions/scripting/lua-bindings/script/framework/display.lua index d12666df15..37fac9e839 100644 --- a/extensions/scripting/lua-bindings/script/framework/display.lua +++ b/extensions/scripting/lua-bindings/script/framework/display.lua @@ -385,13 +385,13 @@ function display.newSprite(source, x, y, params) error(string.format("display.newSprite() - invalid source type \"%s\"", sourceType), 0) else sourceType = tolua.type(source) - if sourceType == "cc.SpriteFrame" then + if sourceType == "ax.SpriteFrame" then if not scale9 then sprite = spriteClass:createWithSpriteFrame(source) else sprite = spriteClass:createWithSpriteFrame(source, params.capInsets) end - elseif sourceType == "cc.Texture2D" then + elseif sourceType == "ax.Texture2D" then sprite = spriteClass:createWithTexture(source) else error(string.format("display.newSprite() - invalid source type \"%s\"", sourceType), 0) @@ -420,7 +420,7 @@ function display.newSpriteFrame(source, ...) if not frame then error(string.format("display.newSpriteFrame() - invalid frame name \"%s\"", tostring(source)), 0) end - elseif tolua.type(source) == "cc.Texture2D" then + elseif tolua.type(source) == "ax.Texture2D" then frame = cc.SpriteFrame:createWithTexture(source, ...) else error("display.newSpriteFrame() - invalid parameters", 0)