Originally Posted by
pkmnfrk
Interestingly, this does have some use (manually drawing a string via tiles, etc), although, not much.
I take this back. They have zero use as implemented.
Code:
int charWidth[96] = {5,3,7,7};
int string_buf[255];
const int string_tile = 14300;
global script onStart {
void run() {
string_buf = "#!#";
while(true) {
drawString(string_tile, 2, 3, 0, 0);
Waitframe();
}
}
}
void drawString(int s_tile, int cset, int lay, int x, int y) {
int dx, dy;
dx = x;
dy = y;
int tile;
for(int i = 0; i < 255; i++) {
if(string_buf[i] < 32) {
if(string_buf[i] = 10) {
dy += 8;
dx = x;
}
} else {
tile = string_buf[i] - 32;
Screen->DrawTile(lay, dx, dy, tile + s_tile, 1, 1, cset, 1, 1, 1, 0, 0, true, 128);
dx += charWidth[tile];
}
}
}
You can't assign to string_buf in any way (other than manually assigning each element), and you can't pass arrays as parameters. For these fake string array things to be useful, you need to be able to do one or the other... I personally don't care which.