include an error when textFont not set

This commit is contained in:
benfry
2005-12-21 05:12:50 +00:00
parent a508849001
commit 7901553e06
+4
View File
@@ -1987,6 +1987,10 @@ public class PGraphics extends PImage implements PConstants {
* ignored.
*/
public void text(String str, float x, float y) {
if (textFont == null) {
throw new RuntimeException("use textFont() before text()");
}
if (textMode == SCREEN) loadPixels();
int length = str.length();