Class: TEF::Animation::Eye
- Inherits:
-
Animatable
- Object
- Animatable
- TEF::Animation::Eye
- Defined in:
- lib/tef/Animation/Eyes.rb
Instance Attribute Summary
Attributes inherited from Animatable
#death_delay, #death_time, #module_id
Instance Method Summary collapse
-
#initialize ⇒ Eye
constructor
A new instance of Eye.
- #set_mood(mood, amount: 1) ⇒ Object
Methods inherited from Animatable
animatable_attr, animatable_color, animatable_coordinate, #configure, #creation_string, #death_time_string, #die!, #die_in, get_attr_list, get_color_list, get_coordinate_list, #get_set_strings, #get_setc_strings, #get_setss_strings, #is_dead?, #send_string
Constructor Details
#initialize ⇒ Eye
Returns a new instance of Eye.
21 22 23 24 25 26 |
# File 'lib/tef/Animation/Eyes.rb', line 21 def initialize() super(); @last_mood = :relaxed; @animatable_colors[:blush].configure({ target: 0xFF000000, delay_a: 1 }); end |
Instance Method Details
#set_mood(mood, amount: 1) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/tef/Animation/Eyes.rb', line 28 def set_mood(mood, amount: 1) if @last_mood != :relaxed @animatable_attributes[@last_mood].add = 0; end return if mood.nil? @last_mood = mood.to_sym; return if @last_mood == :relaxed self.configure({ @last_mood.to_sym => { add: amount, dampen: 0.1 }}); end |