I met two interesting issues today.Below is what i did in my coding
1.In .H file,I declared a float variable "currentPer" and a CCProgressTime variable "_strengthBar"
2.In UIPanGestureRecognizer's call back function "processPanGesture()",I calculated finger's moving distance,Then updated CCProgressTime's percentage attribute.But in screen,The CCProgressTime's visible part is not updated,So my first question is why CCProgressTime is not updated on screen while the percentage attribute is changed?
3.Finally i updated variable "currentPer" with finger's moving distance in call back function processPanGesture() .Then in "update" method,I print the currentPer,But the result is always "0",(If print _stregnthBar's percentage,It is also "0" even though i have changed its value in processPanGesture)Why?I mean i have changed currentPer's value in processPanGesture().But why it doesn't work? If you are still not clear about what i said ,Please see the screen shot.Any help is very precious for me,Thanks for you attention!
Picture 1.AppDelegate.appFinishDidLaunchOption(),Regist PanGestureRecognizer
Picture 2.GameLayer.H file
Picture 3.GameLayer.mm ,init(),Initialize related variables
Picture 4.GameLayer.processPanGesture(),Gesture recognizer's call back function
Picture 5.GameLayer.update()