Skip to content

jkosoy/processing-textmode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Processing TextMode

A TextMode library for Processing, ported from the work done by Paul Greenfell (aka evilpaul).

Documentation

See evilpaul's TextMode Canvas Library post for more information. I tried to stay true to his original method naming and arguments.

Events

Processing doesn't support anonymous functions so there had to be a slight alteration to the original library, specifically the processBox method. As a result there are two ways to implement this method:

From any object, including your sketch's main file:

// this could be your draw method
void somewhere() {
  textModeInstance.processBox(x,y,w,h,this,"functionToCall")
}

// must follow this format
int[] functionToCall(int charId,int colorId) {
  int[] foo = { charId, colorId };
  // do something to foo
  return foo;
}

You could also process a box in a class by implementing the TextModeCallback delegate.

class MyClass implements TextModeCallback {

  void somewhere() {
    myTextMode.processBox(x,y,w,h,"an arbitrary string!",this);
  }

  int[] textModeProcessBoxHandler(String id,int charId,int colorId) {
    int[] foo = { charId, colorId };

    if(id == "an arbitrary string!") {
      // do something to foo
   }

    return foo;
  }
}

Installation Instructions

  1. Copy TextModeScreen.pde and font.png into your sketch.
  2. Follow the example files for additional help.

About

A Processing TextMode library.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages