mirror of https://github.com/axmolengine/axmol.git
fix: type judgment error (#1084)
* fix: type judgment error --------- Co-authored-by: tkzcfc <tkzcfc@users.noreply.github.com> Co-authored-by: 一线灵|Deal <halx99@live.com> Co-authored-by: HYGK-PC\Administrator <tkzc@foxmail.com>
This commit is contained in:
parent
9211db5232
commit
89981bc080
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue