mirror of https://github.com/axmolengine/axmol.git
Merge pull request #13945 from WenhaiLin/v3-physics-testcase-fix
[ci skip]Lua-tests:Fixed physical test cases.
This commit is contained in:
commit
3fc1349561
|
@ -53,7 +53,7 @@ local function addGrossiniAtPosition(layer, p, scale)
|
||||||
|
|
||||||
local sp = cc.Sprite:createWithTexture(layer.spriteTexture, cc.rect(posx, posy, 85, 121))
|
local sp = cc.Sprite:createWithTexture(layer.spriteTexture, cc.rect(posx, posy, 85, 121))
|
||||||
sp:setScale(scale)
|
sp:setScale(scale)
|
||||||
sp:setPhysicsBody(cc.PhysicsBody:createBox(cc.size(48.0*scale, 108.0*scale)))
|
sp:setPhysicsBody(cc.PhysicsBody:createBox(cc.size(48.0, 108.0)))
|
||||||
layer:addChild(sp)
|
layer:addChild(sp)
|
||||||
sp:setPosition(p)
|
sp:setPosition(p)
|
||||||
return sp
|
return sp
|
||||||
|
@ -1650,7 +1650,7 @@ local function PhysicsTransformTest()
|
||||||
local normal = cc.Sprite:create("Images/YellowSquare.png")
|
local normal = cc.Sprite:create("Images/YellowSquare.png")
|
||||||
normal:setPosition(cc.p(300,100))
|
normal:setPosition(cc.p(300,100))
|
||||||
normal:setScale(0.25,0.5)
|
normal:setScale(0.25,0.5)
|
||||||
normal:setPhysicsBody(cc.PhysicsBody:createBox(normal:getContentSize()),cc.PhysicsMaterial(0.1,1.0,0.0))
|
normal:setPhysicsBody(cc.PhysicsBody:createBox(normal:getContentSize(),cc.PhysicsMaterial(0.1,1.0,0.0)))
|
||||||
normal:getPhysicsBody():setTag(DRAG_BODYS_TAG)
|
normal:getPhysicsBody():setTag(DRAG_BODYS_TAG)
|
||||||
_rootLayer:addChild(normal)
|
_rootLayer:addChild(normal)
|
||||||
|
|
||||||
|
@ -1673,8 +1673,7 @@ local function PhysicsTransformTest()
|
||||||
end
|
end
|
||||||
|
|
||||||
initWithLayer(layer, onEnter)
|
initWithLayer(layer, onEnter)
|
||||||
Helper.titleLabel:setString("Reorder issue #9959")
|
Helper.titleLabel:setString("Physics transform test")
|
||||||
Helper.subtitleLabel:setString("Test Scale9Sprite run scale/move/rotation action in physics scene")
|
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1703,7 +1702,8 @@ local function PhysicsIssue9959()
|
||||||
end
|
end
|
||||||
|
|
||||||
initWithLayer(layer, onEnter)
|
initWithLayer(layer, onEnter)
|
||||||
Helper.titleLabel:setString("Physics transform test")
|
Helper.titleLabel:setString("Reorder issue #9959")
|
||||||
|
Helper.subtitleLabel:setString("Test Scale9Sprite run scale/move/rotation action in physics scene")
|
||||||
return layer
|
return layer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue