Slide 14
Slide 14 text
DrumScrollView(ಈ࡞ઃఆ)
func updateViews() {
if self.remainingScrollCount < 0 { return }
if self.shouldFinishScroll { // ఀࢭ࣌
self.setContentOffset(CGPoint(x: 0, y: self.stopTargetPoint), animated: true)
self.gameFinishCallback()
} else if self.shouldSlowDownScroll { // ݮ࣌
let scrollTargetPoint = -(100 + self.contentOffset.y)
self.setContentOffset(CGPoint(x: 0, y: scrollTargetPoint), animated: !self.shouldRewindScroll)
return
} else if self.shouldRewindScroll { // ্ʹୡͨ࣌͠
let scrollTargetPoint = (self.contentSize.height / (CGFloat)(self.drumParam.numberOfReelSet) * 2) + self.contentOffset.y
self.decreaseScrollCount()
self.setContentOffset(CGPoint(x: 0, y: scrollTargetPoint), animated: !self.shouldRewindScroll)
} else { // ௨ৗͷճస࣌
let scrollTargetPoint = -(5000 + self.contentOffset.y)
self.setContentOffset(CGPoint(x: 0, y: scrollTargetPoint), animated: !self.shouldRewindScroll)
}
}
停止後に呼ぶコール
バック後で解説