What does canvas.translate do?

前端 未结 4 1547
野的像风
野的像风 2020-12-23 09:27

An example can be found here compass.java. Api here

4条回答
  •  心在旅途
    2020-12-23 10:11

    Translate - Basically do what it says. Just translate the canvas using x,y. If you want to draw two objects and the one is just translation of the other e.g x2 = x1 + 50 for each point . You don't have to make all your calculations again for the second object but you can just translate the canvas and draw again the same object. I hope this example will help you.

提交回复
热议问题