Class: MovieMaker::Action::Rotate
- Inherits:
-
SpriteAction
- Object
- SpriteAction
- MovieMaker::Action::Rotate
- Defined in:
- lib/movie_maker/action.rb
Overview
ROTATE
Instance Attribute Summary collapse
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
Attributes inherited from SpriteAction
#background, #image, #screen, #sprite, #start_at, #stop_at
Instance Method Summary collapse
- #finalize ⇒ Object
-
#initialize(options = {}, angle = 360) ⇒ Rotate
constructor
A new instance of Rotate.
- #setup ⇒ Object
- #update(time) ⇒ Object
Methods inherited from SpriteAction
#finalized?, #playing?, #started?
Constructor Details
#initialize(options = {}, angle = 360) ⇒ Rotate
Returns a new instance of Rotate.
139 140 141 142 |
# File 'lib/movie_maker/action.rb', line 139 def initialize( = {}, angle = 360) super() @angle = angle end |
Instance Attribute Details
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
138 139 140 |
# File 'lib/movie_maker/action.rb', line 138 def direction @direction end |
Instance Method Details
#finalize ⇒ Object
155 156 157 158 |
# File 'lib/movie_maker/action.rb', line 155 def finalize @sprite.angle = @angle @finalized = true end |
#setup ⇒ Object
144 145 146 147 148 |
# File 'lib/movie_maker/action.rb', line 144 def setup @angle_step = @angle.to_f / @duration.to_f @angle_step = -@angle_step if @framework == :rubygame @setup_done = true end |
#update(time) ⇒ Object
150 151 152 153 |
# File 'lib/movie_maker/action.rb', line 150 def update(time) setup unless @setup_done @sprite.angle = (@angle_step * time) end |