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
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
|
is_active: bool
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. |
__init__(character_id, symbol, input_column, input_row)
Initializes 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 |