1
0

Step_0.gml 578 B

1234567891011121314151617181920
  1. // oTyper Step Event
  2. if active != _prev_active
  3. {
  4. type_direction = active ? 1 : -1;
  5. is_done = false;
  6. char_timer = 0;
  7. _prev_active = active;
  8. }
  9. if is_done exit;
  10. char_timer++;
  11. var _delay = (type_direction == 1) ? char_delay : char_delay_out;
  12. if char_timer < _delay exit;
  13. char_timer = 0;
  14. char_index = clamp(char_index + type_direction, 0, string_length(text_full));
  15. text_shown = string_copy(text_full, 1, char_index);
  16. is_done = (type_direction == 1) ? (char_index >= string_length(text_full))
  17. : (char_index <= 0);