Class: Curtain
- Inherits:
-
TransitionEffect
- Object
- Scene
- TransitionEffect
- Curtain
- Defined in:
- lib/rubysketch/solitaire/common/transitions.rb
Instance Attribute Summary
Attributes inherited from TransitionEffect
Attributes inherited from Scene
Instance Method Summary collapse
- #draw ⇒ Object
- #effect(t) ⇒ Object
-
#initialize(*args, rgb: 0, **kwargs, &block) ⇒ Curtain
constructor
A new instance of Curtain.
Methods inherited from TransitionEffect
Methods inherited from Scene
#activated, #active?, #add, #deactivated, #emitParticle, #focusChanged, #mouseDragged, #mouseMoved, #mousePressed, #mouseReleased, #particle, #pause, #remove, #resized, #resume, #sprites, #transition, #update
Constructor Details
#initialize(*args, rgb: 0, **kwargs, &block) ⇒ Curtain
Returns a new instance of Curtain.
87 88 89 90 91 |
# File 'lib/rubysketch/solitaire/common/transitions.rb', line 87 def initialize(*args, rgb: 0, **kwargs, &block) super(*args, easeIn: :expoOut, **kwargs) @rgb = rgb @y = @h = 0 end |
Instance Method Details
#draw ⇒ Object
101 102 103 104 105 106 |
# File 'lib/rubysketch/solitaire/common/transitions.rb', line 101 def draw() super fill *@rgb noStroke rect 0, @y, width, @h end |
#effect(t) ⇒ Object
93 94 95 96 97 98 99 |
# File 'lib/rubysketch/solitaire/common/transitions.rb', line 93 def effect(t) @y, @h = case phase when :out then [height * (1.0 - t), height] when :in then [0, height * t] end end |