码迷,mamicode.com
首页 > 其他好文 > 详细

quick cocos2dx 滚动条

时间:2014-06-18 22:00:01      阅读:332      评论:0      收藏:0      [点我收藏+]

标签: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

quick cocos2dx 滚动条

标签:get   width   string   os   set   cti   

原文地址:http://www.cnblogs.com/ywnn/p/3790258.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!