cocos2d-x-lua.senchan-office.com
その他|「Cocos Code IDEとLua言語でゲームを作る」逆引き辞典for Lua
http://cocos2d-x-lua.senchan-office.com/other
Cocos Code IDEとLua言語でゲームを作る 逆引き辞典for Lua. Local content = cc.FileUtils:getInstance():getStringFromFile(filename.txt). Require json function test() local result = json.decode({ key =25}) cclog(%d, result.key) end. Local visibleSize = cc.Director:getInstance():getVisibleSize(). Local targetPlatform = cc.Application:getInstance():getTargetPlatform().
cocos2d-x-lua.senchan-office.com
Cocos Code IDEについて|Code IDEについて|ブログ|「Cocos Code IDEとLua言語でゲームを作る」逆引き辞典for Lua
http://cocos2d-x-lua.senchan-office.com/news/archives/2
Cocos Code IDEとLua言語でゲームを作る 逆引き辞典for Lua. ブログ: Cocos Code IDEについて. Cocos Code IDE 以下Code IDE はCocos2d-xを使ってLuaやJavascriptで開発するためのIDEです。 Http:/ www.cocos2d-x.org/.
cocos2d-x-lua.senchan-office.com
メニューを作る|「Cocos Code IDEとLua言語でゲームを作る」逆引き辞典for Lua
http://cocos2d-x-lua.senchan-office.com/menu
Cocos Code IDEとLua言語でゲームを作る 逆引き辞典for Lua. Function GameScene.create() local scene = GameScene.new() local visibleSize = cc.Director:getInstance():getVisibleSize() - メニュー選択時に呼ばれるコールバック関数 local function menuCallback(tag) print(string.format(メニュー%dが押されました, tag) end - 1つ目のメニュー項目 local menuItem1 = cc.MenuItemImage:create(menu1.png, menu1 on.png) menuItem1:setPosition(0, 30) menuItem1:setTag(1) menuItem1:registerScriptTapHandler(menuCallback) - 2つ目のメニュー項目 local menuItem2 = cc.Me...
cocos2d-x-lua.senchan-office.com
イベント処理|「Cocos Code IDEとLua言語でゲームを作る」逆引き辞典for Lua
http://cocos2d-x-lua.senchan-office.com/event
Cocos Code IDEとLua言語でゲームを作る 逆引き辞典for Lua. Function GameScene.create() local scene = GameScene.new() - タッチイベントで呼ばれる関数 local function onTouchBegan(touch, event) local location = touch:getLocation() print(string.format("location = %0.2f, %0.2f", location.x, location.y) - この行は確認のためログに表示するためのもので、必要ありません。 Return true - beganはtrueを返すようにする end local function onTouchMoved(touch, event) end local function onTouchEnded(touch, event) end - タッチイベントの登録 local listener = cc.EventListenerTouchOneByOne:create() listen...
cocos2d-x-lua.senchan-office.com
ブログ|「Cocos Code IDEとLua言語でゲームを作る」逆引き辞典for Lua
http://cocos2d-x-lua.senchan-office.com/news/index
Cocos Code IDEとLua言語でゲームを作る 逆引き辞典for Lua. Cocos Code IDE 以下Code IDE はCocos2d-xを使ってLuaやJavascriptで開発するためのIDEです。
cocos2d-x-lua.senchan-office.com
スプライト|「Cocos Code IDEとLua言語でゲームを作る」逆引き辞典for Lua
http://cocos2d-x-lua.senchan-office.com/sprite
Cocos Code IDEとLua言語でゲームを作る 逆引き辞典for Lua. Function GameScene.create() local scene = GameScene.new() local sprite = cc.Sprite:create(character.png) - 画像ファイルからスプライトを作成 sprite:setPosition(200, 200) scene:addChild(sprite) - シーンにスプライトを加える return scene end. Local sprite = cc.Sprite:create(image.png). AddChild(child, localZOrder, name). AddChild(child, localZOrder, tag). Sprite:setPosition(100.0, 100.0) - スプライトを(100.0,100.0)に表示します。 Nodeクラス setPosition(x,y) メソッド. または、 local x, y = sprite:getPosition(). 名前をつけたスプラ...
cocos2d-x-lua.senchan-office.com
パーティクル|「Cocos Code IDEとLua言語でゲームを作る」逆引き辞典for Lua
http://cocos2d-x-lua.senchan-office.com/particle
Cocos Code IDEとLua言語でゲームを作る 逆引き辞典for Lua. ここでの例では作成したparticle texture.plistとparticle texture.pngファイルをresディレクトリにコピーして使用しています。 Function GameScene.create() local scene = GameScene.new() local particle = cc.ParticleSystemQuad:create(res/particle texture.plist) particle:setPosition(150, 200) particle:setScale(0.3) scene:addChild(particle) return scene end.
cocos2d-x-lua.senchan-office.com
タイルマップを使う|「Cocos Code IDEとLua言語でゲームを作る」逆引き辞典for Lua
http://cocos2d-x-lua.senchan-office.com/tiledmap
Cocos Code IDEとLua言語でゲームを作る 逆引き辞典for Lua. タイルマップの作成には Tiled Map Editor. Local tiledMap = cc.TMXTiledMap:create("tiledmap.tmx") scene:addChild(tiledMap). Local size = tiledMap:getMapSize() - size.width, size.height. Local size = tiledMap:getTileSize() - size.width, size.height. Local property = tiledMap:getProperty("mapname"). Local tiledMapLayer = tiledMap:getLayer("background"). Local objectGroup1 = tiledMap:getObjectGroup("objectGroup1"). Local gid = tiledMapLayer:getTileGIDAt(cc.p(0, 1).
cocos2d-x-lua.senchan-office.com
ラベル|「Cocos Code IDEとLua言語でゲームを作る」逆引き辞典for Lua
http://cocos2d-x-lua.senchan-office.com/label
Cocos Code IDEとLua言語でゲームを作る 逆引き辞典for Lua. Function GameScene.create() local scene = GameScene.new() local visibleSize = cc.Director:getInstance():getVisibleSize() local label = cc.Label:createWithSystemFont(Hello world! Arial, 18) label:setPosition(visibleSize.width/2, visibleSize.height/2) scene:addChild(label) return scene end. Local label = cc.Label:createWithSystemFont(Hello world! Local label = cc.Label:createWithSystemFont(Hello world! CcTEXT ALIGNMENT LEFT 左揃え. CcTEXT ALIGNMENT CENTER 中央揃え. Create...