Hi!

I've been trying to implement a basic camera with the ability to zoom on a given focal point and pan.

At the moment I'm calculating the zoom with a matrix as:

var m:Matrix = this.viewContainer.transformationMatrix; m.translate(-focusPoint.x, -focusPoint.y); m.scale(zoomFactor, zoomFactor); m.translate(focusPoint.x, focusPoint.y); this.viewContainer.transformationMatrix = m;

Where viewContainer is the main display object for my level, focusPoint is the point to zoom around and zoomFactor is how much to zoom by.

This seems to works as intended. The problem I have is now converting a world-space coordinate (such as the coordinates of a mouse click) into local space.

EDIT:

So it turns out I'm just not very clever and when I tried to use the matrix in-built function transformPoint on the inverse matrix, I wasn't assigning the resultas I thought for some reason it operated directly on the given point. MY BAD!

Cheers,

Kaine