It's called a "Clipping Mask", all you've gotta do is this:
Take an image as one layer, then make layer two your text, then duplicate your image layer and put it above your text layer, right click layer three (the duplicated image) and choose "create clipping mask". Then move the clipping mask layer around and that's it. Let me know if that works for you. Photoshop by the way.