Module: Metro::SceneTransitions
- Extended by:
- SceneTransitions
- Included in:
- SceneTransitions
- Defined in:
- lib/metro/transitions/scene_transitions.rb
Instance Method Summary collapse
- #find_transition(name) ⇒ Object
- #generate_transition(name, next_scene, options) ⇒ Object
- #insert_transition(scene, options) ⇒ Object (also: #filter)
- #supported_transitions ⇒ Object
Instance Method Details
#find_transition(name) ⇒ Object
22 23 24 25 |
# File 'lib/metro/transitions/scene_transitions.rb', line 22 def find_transition(name) transition_name = supported_transitions[name] transition_name.constantize end |
#generate_transition(name, next_scene, options) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/metro/transitions/scene_transitions.rb', line 15 def generate_transition(name,next_scene,) transition = find_transition(name).new transition.next_scene = next_scene transition. = transition end |
#insert_transition(scene, options) ⇒ Object Also known as: filter
7 8 9 10 11 |
# File 'lib/metro/transitions/scene_transitions.rb', line 7 def insert_transition(scene,) return scene unless .key?(:with) name = [:with] generate_transition(name,scene,) end |
#supported_transitions ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/metro/transitions/scene_transitions.rb', line 27 def supported_transitions @supported_transitions ||= begin hash = HashWithIndifferentAccess.new("Metro::FadeTransitionScene") hash[:edit] = "Metro::EditTransitionScene" hash end end |