John Singleton says Tupac Shakur's ''spirit'' encouraged him to helm a biopic on the late rapper.

The 46-year-old filmmaker is on board to write, direct and produce the forthcoming film which is based on the life of the star - who he worked with on 1993 romantic drama 'Poetic Justice' - and although he found it difficult to take on the project initially, he insists something ''clicked'' recently.

Talking to The Hollywood Reporter, Singleton said: ''Only recently because it was always there and I had been approached different times. I wasn't emotionally ready to do that. I couldn't even think about it. Several people were involved to do it. I was privately disappointed when I heard other people were doing it but I wouldn't express that. And then it came up three years ago on and off, on and off, and then something clicked in me, which I feel is possibly his spirit, like don't do this. You bet me do this, they're going to f**k my movie up. Literally. I pursued it.''

Singleton is working on penning the script for the project and still hasn't decided who he'd cast as Shakur - who was killed during a Las Vegas drive-by shooting in 1996.

He explained: ''I don't know [who I'd cast]. I have no idea. I'm not even worried about that right now. I'm trying to get the purest vision possible of who he was, good, bad, whatever, on paper, visual. I'm crying over writing it.''

Singleton ''couldn't cope'' when he learned of Shakur's death and escaped the country for a brief period to come to terms with the devastating news.

He recalled: ''I was in my home office. The lady I was dating at the time told me that he had passed, he had been shot days before but he just passed. It set my life on a whole other trajectory. There are things that I did, I went and left the country for about a month. I just couldn't cope. It was something. ''