| 1234567891011121314151617181920 |
- // oTyper Step Event
- if active != _prev_active
- {
- type_direction = active ? 1 : -1;
- is_done = false;
- char_timer = 0;
- _prev_active = active;
- }
- if is_done exit;
- char_timer++;
- var _delay = (type_direction == 1) ? char_delay : char_delay_out;
- if char_timer < _delay exit;
- char_timer = 0;
- char_index = clamp(char_index + type_direction, 0, string_length(text_full));
- text_shown = string_copy(text_full, 1, char_index);
- is_done = (type_direction == 1) ? (char_index >= string_length(text_full))
- : (char_index <= 0);
|