setPosition 指定位置

[PHP]

local GameScene = class("GameScene",function()
return cc.Scene:create()
end)

function GameScene.create()
local scene = GameScene.new()
local layer = cc.Layer:create()
scene:addChild(layer)

local Sprite1 = cc.Sprite:create("res/orange.png" )
Sprite1:setPosition(120,120)
Sprite1:setAnchorPoint(0,0)
layer:addChild(Sprite1,0)

local Sprite2 = cc.Sprite:create("res/watermelon.png" )
Sprite2:setPosition(120,120)
Sprite2:setAnchorPoint(0.5,0.5)
layer:addChild(Sprite2,0)

return scene

end

return GameScene
[/PHP]

cocos2d-x_ch4_v1#.odt

cococs2d-x LUA
CH02 LUACH04 SceneCH05 SpriteCH09 Cocos2d 原始程式CH10 cocos (cocos studio)CH11 工具CH99範例