关卡选择界面

作者: Zi_Fi | 来源:发表于2019-01-28 18:24 被阅读0次

    PageView

      for i=1,count do
            ---创建layout,内容添加到layout
            local layout=ccui.Layout:create()
            layout:setContentSize(cc.size(720,1280))
            layout:setPosition(cc.p(0,0))
            self.pgv_balloons:addPage(layout)---一个layout 为一个 page内容
      end
      self.all_items = self.pgv_balloons:getItems()
      for i,v in ipairs(self.all_items) do
            --添加item
           for i=1,count do
              local levelBaseLayer =  cc.Layer:create()
              local csbNode = gt.loadCSB("res/LevelBaseLayer.csb",self)
              levelBaseLayer:addChild(csbNode)
              self["nod_" .. i]:addChild(LevelBaseLayer)
          end
      end
    

    指示点

    PageView下方的指示点
        self.pgv_balloons:setPositionY(self.pgv_balloons:getPositionY() + 40)
        self.pgv_balloons:setIndicatorEnabled(true)
        self.pgv_balloons:setIndicatorPosition(cc.p(self.pgv_balloons:getContentSize().width*0.5,75))
        self.pgv_balloons:setIndicatorSelectedIndexColor(cc.c3b(255,165,0))
        self.pgv_balloons:setIndicatorIndexNodesColor(cc.c3b(0,0,0))
        self.pgv_balloons:setIndicatorIndexNodesScale(0.5)
        self.pgv_balloons:setIndicatorSpaceBetweenIndexNodes(0)
    

    相关文章

      网友评论

        本文标题:关卡选择界面

        本文链接:https://www.haomeiwen.com/subject/ekczjqtx.html