// CHARACTER DISPLAY
ch <-32;
Init<-0;
// Init display makes a voxel display wall using special display voxels.
function Init_Display(Size)
{
local x,y;
// Clear Zone
for (x=0;x<32;x++)
for (y=0;y<64;y++) UNF_PlaceVoxel3D(x+1,y,0,0);
// Setup the screen
for (x=0;x<Size;x++)
for (y=0;y<Size;y++) UNF_PlaceVoxel3D(x+1,y,0,223);
}
// This function is called repeatedly for each step of the robot.
function Voxel_Step()
{
local x,y,i,j;
// Startup code, build the environnment. Executes only once.
if (Init==0)
{
Init_Display(8);
Init=1;
}
// Display a character.
for (x=0;x<8;x++)
for (y=0;y<8;y++)
{
i = (GetFontPixel(ch,7-x,7-y)!=0) ? 0 : 7;
Voxel_SetInfo(1+x,0+y,0,1,i);
}
// Next display step will display the next character in the ascii table.
ch ++; if (ch>127) ch = 32;
}