【cocos2d-x 3.5】Lua 加载cocostudio的PageView

local pageView = panel_main:getChildByName("PageView_1")
local function pageViewEvent(sender, eventType)
    if eventType == ccui.PageViewEventType.turning then
        local pageView = sender
        local pageInfo = string.format("page %d " , pageView:getCurPageIndex() + 1)
        print(pageInfo)
    end
end 

pageView:addEventListener(pageViewEvent)

你可能感兴趣的:(Lua,cocos2d-x)