mirror of https://github.com/axmolengine/axmol.git
Merge pull request #6341 from samuele3hu/develop_fix
fix two bugs found in the testing
This commit is contained in:
commit
83c1c74475
|
@ -1 +1 @@
|
||||||
1f20f88e2a2985963fc6a2d89ea07be41e8e74d0
|
cd9c6d873768d211ba6ec6fe6d405f0bb1e2a135
|
|
@ -27,7 +27,7 @@ Sprite1.__index = Sprite1
|
||||||
function Sprite1.addNewSpriteWithCoords(layer, point)
|
function Sprite1.addNewSpriteWithCoords(layer, point)
|
||||||
local idx = math.floor(math.random() * 1400 / 100)
|
local idx = math.floor(math.random() * 1400 / 100)
|
||||||
local x = math.floor(math.mod(idx,5) * 85)
|
local x = math.floor(math.mod(idx,5) * 85)
|
||||||
local y = math.floor(idx / 5 * 121)
|
local y = math.floor(idx / 5) * 121
|
||||||
|
|
||||||
local sprite = cc.Sprite:create("Images/grossini_dance_atlas.png", cc.rect(x,y,85,121) )
|
local sprite = cc.Sprite:create("Images/grossini_dance_atlas.png", cc.rect(x,y,85,121) )
|
||||||
layer:addChild( sprite )
|
layer:addChild( sprite )
|
||||||
|
@ -88,7 +88,7 @@ function SpriteBatchNode1.addNewSpriteWithCoords(layer, point)
|
||||||
local BatchNode = layer:getChildByTag( kTagSpriteBatchNode )
|
local BatchNode = layer:getChildByTag( kTagSpriteBatchNode )
|
||||||
local idx = math.floor(math.random() * 1400 / 100)
|
local idx = math.floor(math.random() * 1400 / 100)
|
||||||
local x = math.floor(math.mod(idx,5) * 85)
|
local x = math.floor(math.mod(idx,5) * 85)
|
||||||
local y = math.floor(idx / 5 * 121)
|
local y = math.floor(idx / 5) * 121
|
||||||
|
|
||||||
local sprite = cc.Sprite:createWithTexture(BatchNode:getTexture(), cc.rect(x,y,85,121) )
|
local sprite = cc.Sprite:createWithTexture(BatchNode:getTexture(), cc.rect(x,y,85,121) )
|
||||||
layer:addChild( sprite )
|
layer:addChild( sprite )
|
||||||
|
|
Loading…
Reference in New Issue