Ich habe den Beispielcode für die GestureListener
Klasse gefunden, aber ich verstehe die Zoom-Methode nicht:
private float initialScale = 1;
public boolean zoom (float originalDistance, float currentDistance) {
float ratio = originalDistance / currentDistance; //I get this
camera.zoom = initialScale * ratio; //This doesn't make sense to me because it seems like every time you pinch to zoom, it resets to the original zoom which is 1. So basically it wouldn't 'save' the zoom right?
System.out.println(camera.zoom); //Prints the camera zoom
return false;
}
Interpretiere ich dieses Recht nicht?
zoomStart(float distance)
und eine zoomStop(float initialDistance, float finalDistance)
Methode benötigen