We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi all, i was wondering how to move a camera over a 2D scene bigger than canvas. I should use the P3D camera, ok, but would be a good way to create and draw on a very big PImage and then move it? Thank you all.
Answers
Dragging a PImage is a lot easier than moving the camera view.
Just define the default image position, along with a variable that will move the image for you:
-- MenteCode
how is the 2d scene being generated? tiles?
it's usually better to just render the bit of the screen that's visible rather than keep an enormous picture in memory and only show a bit of it. but it depends what you're doing.
I would create a scene bigger than the canavas using Fisica library, to show the interaction of objects so generated in a big space, but looking at a specific area at time. In other cases, maybe would be usefull render everything inside a PGraphics and then translate it, instead of all the objects. But i don't know if i can put the Fisica object directly inside it.
I just discovered that is possible to render the Fisica object directly inside the a PGraphics like that: "world. draw(PGraphics name)". A problem is that if you try to interact with a object with the mouse their position is referred to the true coordinate in the usual canvas, and if the scales are different can be a problem.