class TEF::Animation::Eye

Public Class Methods

new() click to toggle source
Calls superclass method TEF::Animation::Animatable::new
# File lib/tef/Animation/Eyes.rb, line 21
def initialize()
        super();

        @last_mood = :relaxed;
        @animatable_colors[:blush].configure({ target: 0xFF000000, delay_a: 1 });
end

Public Instance Methods

set_mood(mood, amount: 1) click to toggle source
# 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