You have to update the string-bitmap while inkey is active. Unfortunately, inkey pauses the running function. So, you have to start a coroutine BEFORE you execute inkey which runs as long as inkey is active.
Make a new WDL file called "demo_inkey.wdl" and start it in the sample folder with the sample font to see how it works.
Code:
include "fontRender.wdl";
PANEL pleaseEnterName
{
flags = visible;
pos_x = 10;
pos_y = 10;
layer = 999;
}
PANEL userName
{
flags = visible;
pos_x = 280;
pos_y = 10;
layer = 999;
}
var fontArial[256];
string tempStr;
string userNameStr;
function inkeyRefresh (pnl, &fnt, strInkey);
function main ()
{
vec_set(screen_color, vector(128,128,128));
RF_createFont(fontArial, "arial.tga");
RF_pnlRenderString(pleaseEnterName, fontArial, "Please enter your name:");
inkeyRefresh(userName, fontArial, userNameStr);
inkey(userNameStr); //function will be paused until inkey is over
userName.visible = off;
//say hello to the user
RF_pnlRenderString(pleaseEnterName, fontArial, str_cat(str_cat(str_cpy(tempStr, "Hello, "), userNameStr), "!"));
}
function inkeyRefresh (pnl, &fnt, strInkey)
{
wait(1); //wait to let inkey start (proc_late doesn't work for this)
//wait until inkey is finished
while (inkey_active) {
//update text rendering
RF_pnlRenderString(pnl, fnt, strInkey);
wait(1);
}
}
Cheers, Christian