James Franco has a history of taking on gay film roles, which has inevitably stoked curiosity about his sexuality.

He told the Advocate last year that he was straight, but was more nuanced in a recent interview with Entertainment Weekly.

The star, who is in a long-term relationship with Ahna O’Reilly, said: “It’s funny because the way that kind of stuff is talked about on blogs is so black-and-white.

“It’s all cut-and-dry identity politics. ‘Is he straight or is he gay?’ Or, ‘This is your third gay movie — come out already!’ And all based on, gay or straight, based on the idea that your object of affection decides your sexuality.”

Franco recently played Harvey Milk’s boyfriend Scott Smith in Milk and portrayed the post Allen Ginsberg in Howl.

He said there were plenty of attractions in playing a gay character, especially those who lived at a time when homosexuality was not accepted.

“There are lots of other reasons to be interested in gay characters than wanting myself to go out and have sex with guys,” he said.

“And there are also lots of other aspects about these characters that I’m interested in, in addition to their sexuality. So, in some ways it’s coincidental, in other ways it’s not. I mean, I’ve played a gay man who’s living in the ’60s and ’70s, a gay man who we depicted in the ‘50s, and one being in the ‘20s.

“And those were all periods when to be gay, at least being gay in public, was much more difficult. Part of what I’m interested in is how these people who were living anti-normative lifestyles contended with opposition. Or, you know what, maybe I’m just gay.”

Last week, Rupert Everett, who has frequently spoken about Hollywood’s attitude to homophobia, told BBC Radio 4: “A lot of straight actors are actively searching for gay roles because it is something different to do.

“I think that’s fine but that does mean the gay actor who used to just get to play the gay part – like me – has been reduced to drag really.”