NullPointerException when calling save() after surface.setSize() in P2D

You could use states. Based on the state, draw() performs an action.

  • State 1: draw on a sketch with size A x B
  • State 2: resize sketch and draw on sketch with size C x D
  • State 3: exit

Kf

1 Like