i'm trying make button class tic tac toe game in processing. code class this import processing.core.papplet; public class button extends papplet{ float buttonx; float buttony; float buttonwidth; float buttonheight; boolean cliked; public button(papplet canvas, float buttonx, float buttony, float buttonwidth, float buttonheight) { this.buttonx = buttonx; this.buttony = buttony; this.buttonwidth = buttonwidth; this.buttonheight = buttonheight; } public void drawbutton() { rect(200, 200, 200, 200); textsize(40); fill(200, 200, 200); text("start game", 300, 300); } } the code inside of setup() method processing is button startbutton = new button(this, 200, 200, 200, 200); startbutton.drawbutton(); i have no clue i'm doing wrong, keep receiving nullpointerexception . this caused because you've got 2 classes extend papplet . should have 1 class ...
Comments
Post a Comment