Translate

One of the most useful methods of Matrix is the setTranslate method. A translate simply moves the image on the x and y axes. The setTranslate method takes in two floats representing the amount to move on each axis. The first argument is the amount the image will move on the x axis, and the second argument is the amount the image will move on the y axis. Translating with positive values on the x axis will move the image to the right, while using negative values will move the image to the left. Translating with positive values on the y -axis will move the image downward and using negative values will move the image upward.matrix.

setTranslate(1.5f,-10);.

Was this article helpful?

0 0

Post a comment