Skip to content

Instantly share code, notes, and snippets.

@Double0negative
Created May 3, 2012 05:01
Show Gist options
  • Save Double0negative/2583276 to your computer and use it in GitHub Desktop.
Save Double0negative/2583276 to your computer and use it in GitHub Desktop.
Center text across multiple signs
for(String[] msg:messagequeue){
int x = getSignMidPoint()[1] - (msg.length / 2);
int lineno = x%3;
x = x / 4;
System.out.println(x);
for(int a = msg.length-1; a>-1;a--){
int y = getSignMidPoint()[0] - (msg[a].length() / 2);
System.out.println(msg[a]);
char[] line = msg[a].toCharArray();
for(int b = 0;b<line.length;b++){
System.out.println(y/16+" "+x/4+" "+(3-x)%4+" "+x);
Sign sig = signs [x][((y)/16)];
sig.setLine(lineno,sig.getLine(lineno)+line[b]);
System.out.println(sig.getLine(x%4));
signs [x][((y)/16)].update();
y++;
}
if(lineno == 0){
lineno = 3;
x++;
}
else
lineno--;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment