SettingsΒΆ

Every effect in bruheffect is configured through a settings dataclass. Construct a settings object, populate only the fields you care about (all have defaults), and pass it to the effect constructor. Settings can also be omitted entirely β€” each effect falls back to its own defaults.

from bruhanimate import EffectRenderer, Screen, SnowSettings

def demo(screen):
    renderer = EffectRenderer(screen, float("inf"), 0.05, "snow", " ", False)
    renderer.effect.set_wind(0.6)          # runtime setter
    renderer.run()

Screen.show(demo)

Copyright 2023 Ethan Christensen

Licensed under the Apache License, Version 2.0 (the β€œLicense”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an β€œAS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

class bruhanimate.bruheffect.settings.AudioSettings(mode: str = 'bars', bar_char: str = '|', smoothing: float = 0.7, num_bars: int = 0, color: bool = True, sensitivity: float = 1.0, compact: bool = False)[source]ΒΆ

Bases: object

mode: str = 'bars'ΒΆ
bar_char: str = '|'ΒΆ
smoothing: float = 0.7ΒΆ
num_bars: int = 0ΒΆ
color: bool = TrueΒΆ
sensitivity: float = 1.0ΒΆ
compact: bool = FalseΒΆ
__init__(mode: str = 'bars', bar_char: str = '|', smoothing: float = 0.7, num_bars: int = 0, color: bool = True, sensitivity: float = 1.0, compact: bool = False) NoneΒΆ
class bruhanimate.bruheffect.settings.DrawLinesSettings(char: str = None, thin: bool = False)[source]ΒΆ

Bases: object

char: str = NoneΒΆ
thin: bool = FalseΒΆ
__init__(char: str = None, thin: bool = False) NoneΒΆ
class bruhanimate.bruheffect.settings.FireSettings(intensity: float = 0.2, wind_direction: float = 0.0, wind_strength: float = 0.0, use_char_color: bool = False, background_color: bool = False, swell: bool = False, swell_halt: int = 1, turbulence: float = 0.0, heat_spot_intensity: float = 0.1)[source]ΒΆ

Bases: object

intensity: float = 0.2ΒΆ
wind_direction: float = 0.0ΒΆ
wind_strength: float = 0.0ΒΆ
use_char_color: bool = FalseΒΆ
background_color: bool = FalseΒΆ
swell: bool = FalseΒΆ
swell_halt: int = 1ΒΆ
turbulence: float = 0.0ΒΆ
heat_spot_intensity: float = 0.1ΒΆ
__init__(intensity: float = 0.2, wind_direction: float = 0.0, wind_strength: float = 0.0, use_char_color: bool = False, background_color: bool = False, swell: bool = False, swell_halt: int = 1, turbulence: float = 0.0, heat_spot_intensity: float = 0.1) NoneΒΆ
class bruhanimate.bruheffect.settings.FireworkSettings(firework_type: str = 'circular', color_enabled: bool = False, color_type: str = 'solid', rate: float = 0.05)[source]ΒΆ

Bases: object

firework_type: str = 'circular'ΒΆ
color_enabled: bool = FalseΒΆ
color_type: str = 'solid'ΒΆ
rate: float = 0.05ΒΆ
__init__(firework_type: str = 'circular', color_enabled: bool = False, color_type: str = 'solid', rate: float = 0.05) NoneΒΆ
class bruhanimate.bruheffect.settings.GameOfLifeSettings(decay: bool = False, color: bool = False, color_type: str = 'GREYSCALE', scale: str = 'random')[source]ΒΆ

Bases: object

decay: bool = FalseΒΆ
color: bool = FalseΒΆ
color_type: str = 'GREYSCALE'ΒΆ
scale: str = 'random'ΒΆ
__init__(decay: bool = False, color: bool = False, color_type: str = 'GREYSCALE', scale: str = 'random') NoneΒΆ
class bruhanimate.bruheffect.settings.MatrixSettings(character_halt_range: tuple = (1, 2), color_halt_range: tuple = (1, 2), character_randomness_one: float = 0.7, character_randomness_two: float = 0.6, color_randomness: float = 0.5, gradient_length: int = 1)[source]ΒΆ

Bases: object

character_halt_range: tuple = (1, 2)ΒΆ
color_halt_range: tuple = (1, 2)ΒΆ
character_randomness_one: float = 0.7ΒΆ
character_randomness_two: float = 0.6ΒΆ
color_randomness: float = 0.5ΒΆ
gradient_length: int = 1ΒΆ
__init__(character_halt_range: tuple = (1, 2), color_halt_range: tuple = (1, 2), character_randomness_one: float = 0.7, character_randomness_two: float = 0.6, color_randomness: float = 0.5, gradient_length: int = 1) NoneΒΆ
class bruhanimate.bruheffect.settings.NoiseSettings(intensity: int = 200, color: bool = False)[source]ΒΆ

Bases: object

intensity: int = 200ΒΆ
color: bool = FalseΒΆ
__init__(intensity: int = 200, color: bool = False) NoneΒΆ
class bruhanimate.bruheffect.settings.OffsetSettings(direction: str = 'right')[source]ΒΆ

Bases: object

direction: str = 'right'ΒΆ
__init__(direction: str = 'right') NoneΒΆ
class bruhanimate.bruheffect.settings.PlasmaSettings(color: bool = False, characters: bool = True, random_colors: bool = False, show_info: bool = False)[source]ΒΆ

Bases: object

color: bool = FalseΒΆ
characters: bool = TrueΒΆ
random_colors: bool = FalseΒΆ
show_info: bool = FalseΒΆ
__init__(color: bool = False, characters: bool = True, random_colors: bool = False, show_info: bool = False) NoneΒΆ
class bruhanimate.bruheffect.settings.RainSettings(intensity: int = 1, wind_direction: str = 'none', swells: bool = False, collision: bool = False, lightning: bool = False, lightning_chance: float = 0.02)[source]ΒΆ

Bases: object

intensity: int = 1ΒΆ
wind_direction: str = 'none'ΒΆ
swells: bool = FalseΒΆ
collision: bool = FalseΒΆ
lightning: bool = FalseΒΆ
lightning_chance: float = 0.02ΒΆ
__init__(intensity: int = 1, wind_direction: str = 'none', swells: bool = False, collision: bool = False, lightning: bool = False, lightning_chance: float = 0.02) NoneΒΆ
class bruhanimate.bruheffect.settings.SnowSettings(intensity: float = 0.01, wind: float = 0.0, show_info: bool = False, collision: bool = False)[source]ΒΆ

Bases: object

intensity: float = 0.01ΒΆ
wind: float = 0.0ΒΆ
show_info: bool = FalseΒΆ
collision: bool = FalseΒΆ
__init__(intensity: float = 0.01, wind: float = 0.0, show_info: bool = False, collision: bool = False) NoneΒΆ
class bruhanimate.bruheffect.settings.StarSettings(color_type: str = 'GREYSCALE')[source]ΒΆ

Bases: object

color_type: str = 'GREYSCALE'ΒΆ
__init__(color_type: str = 'GREYSCALE') NoneΒΆ
class bruhanimate.bruheffect.settings.TwinkleSettings(twinkle_chars: list = <factory>, density: float = 0.05)[source]ΒΆ

Bases: object

twinkle_chars: listΒΆ
density: float = 0.05ΒΆ
__init__(twinkle_chars: list = <factory>, density: float = 0.05) NoneΒΆ
class bruhanimate.bruheffect.settings.BoidsSettings(num_boids: int = 60, color: bool = True, char: str = '*', max_speed: float = 1.5, perception: float = 12.0)[source]ΒΆ

Bases: object

num_boids: int = 60ΒΆ
color: bool = TrueΒΆ
char: str = '*'ΒΆ
max_speed: float = 1.5ΒΆ
perception: float = 12.0ΒΆ
__init__(num_boids: int = 60, color: bool = True, char: str = '*', max_speed: float = 1.5, perception: float = 12.0) NoneΒΆ
class bruhanimate.bruheffect.settings.SandSettings(color: bool = True, char: str = '#', spawn_rate: float = 0.2)[source]ΒΆ

Bases: object

color: bool = TrueΒΆ
char: str = '#'ΒΆ
spawn_rate: float = 0.2ΒΆ
__init__(color: bool = True, char: str = '#', spawn_rate: float = 0.2) NoneΒΆ
class bruhanimate.bruheffect.settings.DiffusionSettings(color: bool = True, char: str = '.', f: float = 0.055, k: float = 0.062, steps_per_frame: int = 8)[source]ΒΆ

Bases: object

color: bool = TrueΒΆ
char: str = '.'ΒΆ
f: float = 0.055ΒΆ
k: float = 0.062ΒΆ
steps_per_frame: int = 8ΒΆ
__init__(color: bool = True, char: str = '.', f: float = 0.055, k: float = 0.062, steps_per_frame: int = 8) NoneΒΆ
class bruhanimate.bruheffect.settings.AutomatonSettings(color: bool = True, char: str = '#', rule: int = 30)[source]ΒΆ

Bases: object

color: bool = TrueΒΆ
char: str = '#'ΒΆ
rule: int = 30ΒΆ
__init__(color: bool = True, char: str = '#', rule: int = 30) NoneΒΆ
class bruhanimate.bruheffect.settings.VoronoiSettings(color: bool = True, char: str = '#', num_seeds: int = 12, seed_speed: float = 0.3)[source]ΒΆ

Bases: object

color: bool = TrueΒΆ
char: str = '#'ΒΆ
num_seeds: int = 12ΒΆ
seed_speed: float = 0.3ΒΆ
__init__(color: bool = True, char: str = '#', num_seeds: int = 12, seed_speed: float = 0.3) NoneΒΆ
class bruhanimate.bruheffect.settings.PerlinSettings(color: bool = True, char: str = '.', octaves: int = 4, speed: float = 0.015, threshold: float = 0.35)[source]ΒΆ

Bases: object

color: bool = TrueΒΆ
char: str = '.'ΒΆ
octaves: int = 4ΒΆ
speed: float = 0.015ΒΆ
threshold: float = 0.35ΒΆ
__init__(color: bool = True, char: str = '.', octaves: int = 4, speed: float = 0.015, threshold: float = 0.35) NoneΒΆ