参考模块与包:
http://www.jellythink.com/archives/526
字符串函数:
http://www.jellythink.com/archives/544
cocos studio
http://cn.cocos2d-x.org/tutorial/show?id=502
http://cn.cocos2d-x.org/tutorial/lists?id=39
简单说说Lua中的面向对象
http://www.jellythink.com/archives/529
Mac下使用Cocos2d-x Lua 3.2加载Cocos Studio 1.0beta导出的Json
http://cn.cocos2d-x.org/tutorial/show?id=1408
linux shell:------------>
http://www.jellythink.com/archives/699
------------cocos2d-x的lua脚本如何获得Cocostudio中UI控件的对象----------------------
如何获取UI上的控件呢?答案是通过Name或Tag查找,使用函数getChildByName() 或 getChildByTag()。
以Button为例,代码如下:
local function createCocostudioUI()
local ccsLayout = ccs.GUIReader:shareReader():widgetFromJsonFile("DemoLogin/DemoLogin.json")
--local ccsButton = ccsLayout:getChildByName("login_Button")
local ccsButton = ccsLayout:getChildByTag(14)
ccsButton:addTouchEventListener(function(...)
ccsLayout:setVisible(false)
end)
return ccsLayout
end
--------------初始的UI加入进来吧---------------------
----初始化基类界面----
function RankingListCtl:InitConsRoot(...)
self.root = GUIReader:shareReader():widgetFromJsonFile(gRes_CSUIPath.."/RankingList.json")
end
--------------------GUI系统-------------------------
--------------滑动条跟随listview的滑动效果--------------
local Panel_2 = tolua.cast(UIHelper:seekWidgetByName(self.root,"Panel_2"),"Panel") --容器
local ListView_right = tolua.cast(UIHelper:seekWidgetByName(self.root,"ListView_right"),"ListView") --列表容器、
-- local Slider_right = tolua.cast( UIHelper:seekWidgetByName( self.root, "Slider_right" ) , "Slider") --右边滑动条
self.initHandlerSilder = CCDirector:sharedDirector():getScheduler():scheduleScriptFunc( function ( )
CCDirector:sharedDirector():getScheduler():unscheduleScriptEntry( self.initHandlerSilder )
gUtils:SetupScrollIndicator( ListView_right, tolua.cast( UIHelper:seekWidgetByName( self.root , "Slider_right" ) , "Slider") )
end, 0, false )
--------