Skip to main content
added 406 characters in body
Source Link
5Mixer
  • 180
  • 7

If I understand the question correctly, you want a camera that you can move, which is not a standard with vanilla canvas. To emulate this with canvas, you should create variabletwo variables for the locationx and y position of the canvas which youcamera. You can changethen manipulate these values for instance if you want the camera to move when the cameraplayer moves. Now forTo make all your scenes objects act properly with the camera, you should offset all of your draw calls with the x and y of the camera, simply subtractby subtracting the camera'scameras position from theirwith the objects position. This can turn messy having to put the offset on everything you draw, so you might want to write some code that you can call to offset all the values automatically.

If I understand the question correctly, you want a camera that you can move. To emulate this with canvas create variable for the location of the canvas which you can change to move the camera. Now for all your objects, simply subtract the camera's position from their position.

If I understand the question correctly, you want a camera that you can move, which is not a standard with vanilla canvas. To emulate this, you should create two variables for the x and y position of the camera. You can then manipulate these values for instance if you want the camera to move when the player moves. To make all your scenes objects act properly with the camera, you should offset all of your draw calls with the x and y of the camera, simply by subtracting the cameras position with the objects position. This can turn messy having to put the offset on everything you draw, so you might want to write some code that you can call to offset all the values automatically.

deleted 129 characters in body
Source Link
House
  • 73.5k
  • 17
  • 188
  • 276

I would comment, but some weird glitch on the ipad isn't letting me.

If I understand the question correctly, you want a camera that you can move. To emulate this with canvas create variable for the location of the canvas which you can change to move the camera. Now for all your objects, simply subtract the camerascamera's position from their position. I hope you understand, for clarification please comment :)

I would comment, but some weird glitch on the ipad isn't letting me.

If I understand the question correctly, you want a camera that you can move. To emulate this with canvas create variable for the location of the canvas which you can change to move the camera. Now for all your objects, simply subtract the cameras position from their position. I hope you understand, for clarification please comment :)

If I understand the question correctly, you want a camera that you can move. To emulate this with canvas create variable for the location of the canvas which you can change to move the camera. Now for all your objects, simply subtract the camera's position from their position.

Source Link
5Mixer
  • 180
  • 7

I would comment, but some weird glitch on the ipad isn't letting me.

If I understand the question correctly, you want a camera that you can move. To emulate this with canvas create variable for the location of the canvas which you can change to move the camera. Now for all your objects, simply subtract the cameras position from their position. I hope you understand, for clarification please comment :)