Guest User

Untitled

a guest
Apr 22nd, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. def smoothChange(duration, from, to)
  2. timeLine = Qt::TimeLine.new(duration, self)
  3. timeLine.setFrameRange(from, to)
  4. timeLine.curveShape = Qt::TimeLine::EaseInCurve
  5. connect(timeLine, SIGNAL('frameChanged(int)')) { |i| yield i }
  6. timeLine.start
  7. end
  8.  
  9. def mousePressEvent(event)
  10. case event.button
  11. when Qt::LeftButton then @bullets.push Bullet.new(@position)
  12. when Qt::MidButton
  13. smoothChange(500, 90, 45) { |i| self.fov = i }
  14. end
  15. end
Add Comment
Please, Sign In to add comment