Class: TransitionEffect
- Defined in:
- lib/rubysketch/solitaire/common/transitions.rb
Instance Attribute Summary collapse
-
#phase ⇒ Object
readonly
Returns the value of attribute phase.
Attributes inherited from Scene
Instance Method Summary collapse
- #activated ⇒ Object
- #effect(t) ⇒ Object
-
#initialize(nextScene, sec: 1, secOut: nil, secIn: nil, easeOut: :expoOut, easeIn: :expoIn, showAd: false, &block) ⇒ TransitionEffect
constructor
A new instance of TransitionEffect.
Methods inherited from Scene
#active?, #add, #deactivated, #draw, #emitParticle, #focusChanged, #mouseDragged, #mouseMoved, #mousePressed, #mouseReleased, #particle, #pause, #remove, #resized, #resume, #sprites, #transition, #update
Constructor Details
#initialize(nextScene, sec: 1, secOut: nil, secIn: nil, easeOut: :expoOut, easeIn: :expoIn, showAd: false, &block) ⇒ TransitionEffect
Returns a new instance of TransitionEffect.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rubysketch/solitaire/common/transitions.rb', line 6 def initialize( nextScene, sec: 1, secOut: nil, secIn: nil, easeOut: :expoOut, easeIn: :expoIn, showAd: false, &block) super() @nextScene, @easeOut, @easeIn, @showAd, @block = nextScene, easeOut, easeIn, showAd, block @secOut = secOut || sec / 2.0 @secIn = secIn || sec / 2.0 @phase = :out end |
Instance Attribute Details
#phase ⇒ Object (readonly)
Returns the value of attribute phase.
21 22 23 |
# File 'lib/rubysketch/solitaire/common/transitions.rb', line 21 def phase @phase end |
Instance Method Details
#activated ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/rubysketch/solitaire/common/transitions.rb', line 26 def activated() super start do case @phase when :out sendCommand :showInterstitialAd if @showAd delay do pa = parent pa.remove self @phase = :in @nextScene.add self pa.transition @nextScene @block.call if @block end when :in parent.remove self end end end |
#effect(t) ⇒ Object
23 24 |
# File 'lib/rubysketch/solitaire/common/transitions.rb', line 23 def effect(t) end |