Page 1 of 1

Newb question, how to display text at x y location

Posted: Mon Jul 08, 2013 1:35 pm
by Wolfgange
Does anyone know the simplest way to display consol text at the x y location of a variable? Currently I use iprintf("\x1b[9;9HRandom Text"); to show "Random Text" at 9,9. How can I display it at the location of variable lets say locationx and locationy?

Re: Newb question, how to display text at x y location

Posted: Tue Jul 16, 2013 3:32 pm
by mtheall
Well that's easy.

Code: Select all

iprintf("\x1b[%d;%dHRandom Text", locationx, locationy);
You may have to switch x and y. I don't remember which order it goes in.

Re: Newb question, how to display text at x y location

Posted: Tue Aug 27, 2013 2:24 pm
by dovoto
You can also manipulate the conslol a bit more directly:

Code: Select all

PrintConsole* pc = consoleDemoInit();

pc->cursorX = 10;
pc->cursorY = 10;

iprintf("hi");
 
Here are some of the other things you can adjust: http://libnds.devkitpro.org/a00087.html