Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (single_line)
- {
- //Calculate the amount of characters visible
- //Avoid negative start character
- start = max(0, start);
- //Find minimum position
- ww = 0;
- for (a = string_length(line[0]); a >= 0; a--)
- {
- ww += string_width(string_replace(string_char_at(line[0], a), "#", "\#")) * image_xscale;
- b = a;
- if (ww > w) break;
- }
- start = min(b, start);
- //Calculate visible
- ww = 0;
- chars = 0;
- for (a = start + 1; a <= string_length(line[0]); a++)
- {
- ww += string_width(string_replace(string_char_at(line[0], a), "#", "\#")) * image_xscale;
- if (ww > w) break;
- chars++
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement