cc.ControlSlider

-- 滑动条

local slider = cc.ControlSlider:create(

cc.Sprite:create("lobby/priRoom/huakuai1.png"),

cc.Sprite:create("lobby/priRoom/huakuai2.png"),

cc.Sprite:create("lobby/priRoom/chips.png")

)

slider:align( display.CENTER, tipsBgSize.width / 2, tipsBgSize.height / 2 + 10 )

slider:setEnabled( true )

slider:registerControlEventHandler( function ()

                    print("监听滑动条改变", slider:getValue() )

end, cc.CONTROL_EVENTTYPE_VALUE_CHANGED )

slider:setMinimumValue( 0 )

slider:setMaximumValue( 1 )

tipsBg:addChild( slider )

你可能感兴趣的:(cc.ControlSlider)