Class: Shoes::Swt::Animation
- Inherits:
-
Object
- Object
- Shoes::Swt::Animation
- Defined in:
- shoes-swt/lib/shoes/swt/animation.rb
Instance Attribute Summary collapse
-
#task ⇒ Object
readonly
Returns the value of attribute task.
Instance Method Summary collapse
- #eval_block ⇒ Object
-
#initialize(dsl, app) ⇒ Animation
constructor
An Swt animation implementation.
Constructor Details
#initialize(dsl, app) ⇒ Animation
An Swt animation implementation
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'shoes-swt/lib/shoes/swt/animation.rb', line 12 def initialize(dsl, app) @dsl = dsl @app = app # Wrap the animation block so we can count frames. # Note that the task re-calls itself on each run. @task = proc do unless animation_removed? run_animation unless @dsl.stopped? schedule_next_animation end end schedule_next_animation end |
Instance Attribute Details
#task ⇒ Object (readonly)
Returns the value of attribute task.
6 7 8 |
# File 'shoes-swt/lib/shoes/swt/animation.rb', line 6 def task @task end |
Instance Method Details
#eval_block ⇒ Object
27 28 29 |
# File 'shoes-swt/lib/shoes/swt/animation.rb', line 27 def eval_block @dsl.blk.call(@dsl.current_frame) end |