The X-ray Telescope for NASA's Swift mission incorporates a Telescope Alignment Monitor (TAM) to measure thermo-elastic misalignments between the telescope and the spacecraft star tracker. A LED in the X-ray focal plane is imaged on to a position-sensitive detector via two paths, directly and after reflection from the star tracker alignment cube. The separation of the two spots of light on the detector is determined with sub-pixel accuracy using a centroiding algorithm. The active element of the TAM is a miniature camera supplied by Sira Electro-Optics Ltd, using an Active Pixel Sensor (APS). The camera was based on similar pointing sensors developed on European Space Agency programmes, such as acquisition sensors for optical inter-satellite links and miniaturized star trackers. The paper gives the background to APS-based pointing sensors, describes the Swift TAM system, and presents test results from the instrument development programme.