Class: Fade
- Inherits:
-
TransitionEffect
- Object
- Scene
- TransitionEffect
- Fade
- 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) ⇒ Fade
constructor
A new instance of Fade.
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) ⇒ Fade
Returns a new instance of Fade.
66 67 68 69 |
# File 'lib/rubysketch/solitaire/common/transitions.rb', line 66 def initialize(*args, rgb: 0, **kwargs, &block) super(*args, easeIn: :expoOut, **kwargs) @rgb, @alpha = rgb, 0 end |
Instance Method Details
#draw ⇒ Object
75 76 77 78 79 80 |
# File 'lib/rubysketch/solitaire/common/transitions.rb', line 75 def draw() super fill *@rgb, @alpha noStroke rect 0, 0, width, height end |
#effect(t) ⇒ Object
71 72 73 |
# File 'lib/rubysketch/solitaire/common/transitions.rb', line 71 def effect(t) @alpha = 255 * t end |