这是什么canvas.translate办?这是什么、canvas、translate

2023-09-06 13:29:47 作者:誓言是蛊惑人心的毒药

这是实施例可以在这里compass.java. Api这里

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

推荐答案

翻译 - 基本上做什么它说。只用X,Y翻译画布。如果你想得出两个对象和一个只是翻译其他如X2 = X1 + 50的每个点。你不必让所有的计算再次为第二个对象,但你可以转换画布绘制再次同一个对象。我希望这个例如会帮助你。

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.

 
精彩推荐