-
-
Save X-Raym/516dfe0a9a60a07dd07ab2421bc9d2c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pstring(str) | |
( | |
gfx_str_measure(str, txtw, txth); | |
gfx_x = (project_w-txtw)/2; | |
gfx_str_draw(str); | |
txth; // return text height | |
); | |
function domatch(fmt, txt) | |
( | |
ptr = 0; | |
strcpy(ptr, txt); | |
count = 0; | |
while | |
( | |
retval = match(fmt, ptr, ptr+2, ptr+1); | |
ptr += 2; | |
count += 1; | |
retval; | |
); | |
strcpy(ptr-1, ptr-2); | |
count; // return number of strings | |
); | |
#fmt = "%s\n%s"; | |
#text="What do You think of that?\nAwesome!\nRight?"; // set to string to override | |
// match("%s\n%s",#text, #line1, #line2 ); // matches the LAST \n (not the first) | |
count = domatch(#fmt, #text); | |
gfx_r = 1; | |
gfx_y = 0; | |
loop(count, | |
gfx_y += pstring(2*count-1); | |
count -= 1; | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment