Class: UI::WeatherSprite

Inherits:
Object show all
Defined in:
docs/5_Battle_02_Visual.rb

Overview

Class responsible for managing weather animations in the battle scene. This class handles different weather effects and transitions back to a neutral state (:none) after the animation ends.

Defined Under Namespace

Classes: HailAnimation, RainAnimation, SandStormAnimation, SunnyAnimation

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(viewport, scene) ⇒ WeatherSprite

Initializes the WeatherSprite

Parameters:

  • viewport (Viewport) —

    The viewport where the sprites are displayed

  • scene (Battle::Scene) —

    The battle scene instance



2798
2799
# File 'docs/5_Battle_02_Visual.rb', line 2798

def initialize(viewport, scene)
end

Instance Attribute Details

#animation_handler ⇒ Yuki::Animation::Handler{ Symbol => Yuki::Animation::TimedAnimation } (readonly)

Animation handler for the weather animations



2774
2775
2776
# File 'docs/5_Battle_02_Visual.rb', line 2774

def animation_handler
  @animation_handler
end

#current_weather_animation ⇒ WeatherSprite? (readonly)

Currently active weather animation

Returns:



2780
2781
2782
# File 'docs/5_Battle_02_Visual.rb', line 2780

def current_weather_animation
  @current_weather_animation
end

#db_symbol ⇒ Symbol (readonly)

Symbol representing the current weather

Returns:

  • (Symbol)


2777
2778
2779
# File 'docs/5_Battle_02_Visual.rb', line 2777

def db_symbol
  @db_symbol
end

Class Method Details

.register(db_symbol, klass)

This method returns an undefined value.

Registers a new weather class

Parameters:

  • db_symbol (Symbol) —

    The weather type (e.g., :rain, :sunny)

  • klass (Class<WeatherSprite>) —

    The class responsible for handling this weather type



2787
2788
# File 'docs/5_Battle_02_Visual.rb', line 2787

def register(db_symbol, klass)
end

.registered_class(db_symbol) ⇒ Class<WeatherSprite>

Retrieves the registered class for a specific weather

Parameters:

  • db_symbol (Symbol) —

    The weather type (e.g., :rain)

Returns:

  • (Class<WeatherSprite>) —

    The registered class or WeatherSprite



2792
2793
# File 'docs/5_Battle_02_Visual.rb', line 2792

def registered_class(db_symbol)
end

Instance Method Details

#done? ⇒ Boolean

Checks if the weather animation is finished

Returns:

  • (Boolean) —

    True if no animation is active or the current animation is done



2810
2811
# File 'docs/5_Battle_02_Visual.rb', line 2810

def done?
end

#init_weather_animation

Init the Weather Animation



2801
2802
# File 'docs/5_Battle_02_Visual.rb', line 2801

def init_weather_animation
end

#show_weather_animation(weather)

This method returns an undefined value.

Displays the animation for a specific weather type If a weather animation is already playing, it stops the current one before starting the new one

Parameters:

  • weather (Symbol) —

    The type of weather animation to display (e.g., :rain, :sunny)



2816
2817
# File 'docs/5_Battle_02_Visual.rb', line 2816

def show_weather_animation(weather)
end

#stop_current_animation

This method returns an undefined value.

Stops the current weather animation and returns to a neutral state



2820
2821
# File 'docs/5_Battle_02_Visual.rb', line 2820

def stop_current_animation
end

#update

This method returns an undefined value.

Updates the WeatherSprite and the animation handler Automatically returns to a neutral state if the current animation is done



2806
2807
# File 'docs/5_Battle_02_Visual.rb', line 2806

def update
end