Test Post

Posted 02 September 2002

<-back

I am leaving this here so my blog doesn’t look completely bare until I actually think of something to post.

Lorem ipsum etc.

Code Example

Here’s a snippet from my recent project lava. It just renders basic text to the screen after everything’s been drawin, so you can do per-frame debugging without having to print to the console 60+ times a second.

public void drawDebugText(string input) {
  if(!debugTextSprite){
    debugTextSprite = new Sprite("source/debugFont.gif", 12, 13);
  }
  debugTextBuffer ~= input;
}
public void outputDebugText() {
  for (int row = 0; row < debugTextBuffer.length(); row++){
    string text = debugTextBuffer[row];
    for(int i=0; i<text.length;i++){
      char letter = text[i];
      screen.drawSprite(debugTextSprite, 
        cast(int)indexOf(DEBUGALPHABET, letter), 5+i*9, 5+15*row);
    }
  }
  debugTextBuffer.clear();
}

Cool! Thanks for reading

<-back