2D PGraphics on top of 3D, Type Error
in
Processing with Other Languages
•
26 days ago
- PGraphics hud;
- void setup() {
- size(200,200,P3D);
- hud = createGraphics(200,200,P2D);
- }
- void draw() {
- image(hud, 0, 0);
- }
The above code produces "Uncaught TypeError: Type error" but it runs fine if the renderer is set to P2D rather than P3D, does this mean that I can't use PGraphics using 2D renderers with 3D renderers?
Also, if I use P2D for the main renderer and use P3D on a PGraphics it works fine, so would I be able to do the below instead?
- PGraphics game;
- PGraphics hud;
- void setup() {
- size(200,200,P2D);
- game = createGraphics(200,200,P3D);
- hud = createGraphics(200,200,P2D);
- }
- void draw() {
- image(game, 0, 0);
- image(hud, 0, 0);
- }
Really I'm just looking for a way to use a 2D PGraphics on top of a 3D sketch.
1