Hi, I'm trying to print the location of my vehicle (in two dimensions) on screen for every frame. The problem I'm encountering is that the text doesn't clear from its previous numbers so it ends up writing over its self. Can anyone show me how to printing text that doesn't write over itself?
Current code:
void Print::Update()
{
dbText(dbScreenWidth()/8, dbScreenHeight()/8,"Mouse location:");
char* x = dbStr(mouse->brain->x);
char* y = dbStr(mouse->brain->y);
dbText(dbScreenWidth()/8 + dbTextWidth("Mouse location: "), dbScreenHeight()/8,x);
dbText(dbScreenWidth()/8 + (dbTextWidth("Mouse location: ") + dbTextWidth(x)), dbScreenHeight()/8,",");
dbText(dbScreenWidth()/8 + (dbTextWidth("Mouse location: ") + dbTextWidth(x) + dbTextWidth(",")), dbScreenHeight()/8,y);
}