Discussions
Positioning avatar using offset and scale
19 days ago by Sam Mazniker
Hello, I am trying to programmatically calculate the offset x and y to correctly position my photo avatar on my image background.
I understand that the value should be between -1 and 1 for x and y, but how to calculate it? Should i divide the length and height of the photo avatar and the background image and calculate the scale and pass it? Or what? What's the mathematics behind it, can you please explain?