Thank you Lactose, I got it to work, but its rather slow here is the code, it works like I want it to:
//Scrolling text box function
void DrawScrollText(char text[], int &x, int y)
{
oldTime = timeElapsed;
timeElapsed = al_get_time() - tickCounter;
storage[0] = text[timeElapsed];
if(timeElapsed < strlen(text))
{
if(timeElapsed != oldTime)
al_play_sample_instance(beepInstance);
}
else
{
timeElapsed = strlen(text);
return;
}
}
void CharsToPrint(int numCharsToPrint, char text[], int x, int y)
{
for(int i = 0; i < numCharsToPrint; i++)
{
s[0] = text[i];
al_draw_text(font, al_map_rgb(255, 255, 255), x, y, NULL, s);
x += al_get_text_width(font, s);
}
}