From 7901553e06fb6e44c5b04e7a4aac8b114ff94c32 Mon Sep 17 00:00:00 2001 From: benfry Date: Wed, 21 Dec 2005 05:12:50 +0000 Subject: [PATCH] include an error when textFont not set --- core/PGraphics.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/PGraphics.java b/core/PGraphics.java index 1b0d632df..c7298a7fd 100644 --- a/core/PGraphics.java +++ b/core/PGraphics.java @@ -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();