EffectCharacter
Module: terminaltexteffects.engine.base_character
A class representing a single character from the input data.
EffectCharacters are managed by the Terminal and are used to apply animations and effects to individual characters. Add an EffectCharacter to the Terminal using the add_character method of the Terminal class.
Methods:
Name | Description |
---|---|
tick |
Progress the character's animation and motion by one step. |
Attributes:
Name | Type | Description |
---|---|---|
character_id |
int
|
The unique ID of the character, generated by the Terminal. |
input_symbol |
str
|
The symbol for the character in the input data. |
input_coord |
Coord
|
The coordinate of the character in the input data. |
is_visible |
bool
|
Whether the character is currently visible and should be printed to the terminal. |
animation |
Animation
|
The animation object that controls the character's appearance. |
motion |
Motion
|
The motion object that controls the character's movement. |
event_handler |
EventHandler
|
The event handler object that handles events related to the character. |
layer |
int
|
The layer of the character. The layer determines the order in which characters are printed. |
is_fill_character |
bool
|
Whether the character is a fill character. Fill characters are used to fill the empty cells of the Canvas. |
Source code in terminaltexteffects/engine/base_character.py
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 |
|
character_id
property
The unique ID of the character, generated by the Terminal.
input_coord
property
The coordinate of the character in the input data.
input_symbol
property
The symbol for the character in the input data.
is_active
property
Returns whether the character is currently active.
A character is active if its animation or motion is not complete.
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the character is active, False if not. |
is_visible
property
Whether the character is currently visible and should be printed to the terminal.
__eq__(other)
Check if two EffectCharacter instances are equal based on their character_id.
Source code in terminaltexteffects/engine/base_character.py
__hash__()
__init__(character_id, symbol, input_column, input_row)
Initialize the character instance with the character ID, symbol, and input coordinates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
character_id
|
int
|
The unique ID of the character, generated by the Terminal. |
required |
symbol
|
str
|
The symbol for the character in the input data. |
required |
input_column
|
int
|
The column of the character in the input data. |
required |
input_row
|
int
|
The row of the character in the input data. |
required |
Source code in terminaltexteffects/engine/base_character.py
__repr__()
Return a string representation of the EffectCharacter instance.