标签:get width string os set cti
--滚动条 labar
local function valueChanged(strEventName,pSender)
if nil == pSender then
return
end
local pControl = tolua.cast(pSender,"CCControlSlider")
local strFmt = nil
if pControl:getTag() == 10 then
print(pControl:getValue())
elseif pControl:getTag() == 2 then
print(pControl:getValue())
end
if nil ~= strFmt then
--pDisplayValueLabel:setString(CCString:create(strFmt):getCString())
end
end
local pSlider = CCControlSlider:create("res/sliderTrack.png","res/sliderProgress.png" ,"res/sliderThumb.png")
pSlider:setAnchorPoint(ccp(0.5, 1.0))
pSlider:setPosition(ccp(s.width / 2.0, s.height / 2.0))
pSlider:setMinimumValue(0.0)
pSlider:setMaximumValue(100.0)
pSlider:setTag(10)
--pSlider:setValue(3.0)
bglayer:addChild(pSlider,4)
pSlider:addHandleOfControlEvent(valueChanged, CCControlEventValueChanged)
--------------------
local to1 = CCProgressTo:create(1, 100)
local newTitle = CCProgressTimer:create(display.newSprite("#img_lvup_title.png"))
newTitle:setType(kCCProgressTimerTypeBar)
newTitle:setMidpoint(CCPointMake(0, 0))
newTitle:setBarChangeRate(CCPointMake(1, 0))
newTitle:setPosition(self.ImgTitle:getPosition())
newTitle:runAction(to1)
self:addChild(newTitle,100)
quick cocos2dx 滚动条,布布扣,bubuko.com
标签:get width string os set cti
原文地址:http://www.cnblogs.com/ywnn/p/3790258.html