Can anyone help or give ideas on how to use HTML5 canvas translate to make a scrolling camera to follow an object?
Asked
Active
Viewed 5,394 times
1 Answers
2
You want to use ctx.translate(x, y)
to move the canvas context while you draw your objects normally.
For more detail and suggestions see my answer here: 2D side scrolling camera view in html5
The accepted answer for that question is another valid way of doing things but is much worse performance-wise.

Community
- 1
- 1

Simon Sarris
- 62,212
- 13
- 141
- 171