Like many boys growing up in Hong Kong, Tony Leung was a fan of Bruce Lee from a young age.

But it wasn't until he played the kung fu master's teacher that he understood the man—or kung fu, for that matter.

In "The Grandmaster," opening in New York on Friday, Mr. Leung plays Ip Man, the martial-arts master who taught a core group of disciples, including Lee. Ip Man, who was raised in Southern China but later moved to Hong Kong, isn't as well-known as Lee stateside, but he too has been immortalized in film, most notably by Donnie Yen in 2008's "Ip Man."

Tony Leung takes on the role of Ip Man in 'The Grandmaster.' Weinstein Company/Everett Collection

To create an original interpretation, Mr. Leung took a tip from "Grandmaster" director and longtime collaborator Wong Kar-wai (this is their seventh film together): Blend the master teacher with the master student.

"When you look at the books of Bruce Lee or his letters and interviews, a lot of his inspiration came from Ip Man," Mr. Wong said. "I think it's a very good approach to show the audience where the inspiration came from. Who made Bruce Lee who he was?"

As a result, Mr. Leung studied not only Ip Man's martial-arts technique—suffering a broken arm twice during training—he also read Lee's extensive writings. "It helped me not to just have the look of a grandmaster, but have the state of mind and the soul of the grandmaster," he said.

Though no stranger to demanding roles (he played a cuckolded man drawn toward a neighbor in "In the Mood for Love," then a political agent entangled with a spy in Ang Lee's NC-17-rated "Lust, Caution"), Mr. Leung had plenty of time to prepare for "Grandmaster." He began kung fu training over a year before production, and shooting stretched out over three years.

He spoke with the Journal about staying in character over that period, nonviolent action scenes and how a sickly-looking Mr. Wong helped him press on. Excerpts from the conversation:

You were familiar with Bruce Lee before filming, but how much did you know about kung fu?

Actor Tony Leung Getty Images

I thought kung fu was just a fighting technique, but after I finished this movie, I know it's not just a self-defense method but also a lot of philosophy. A mind-cultivation practice. You can apply it to life. During the transformation of kung fu, it was greatly influenced by Taoism and Zen. What attracts me at the end is not the techniques. I was attracted by the mind training. It's very much like meditation.

Were you spiritual before this?

I'm Buddhist, so I meditate sometimes. I find there's a lot of similarity between Taoism and Buddhism. But the spiritual side of kung fu cannot be learned just by reading books. You cannot learn it by fact-finding and instruction.

You were in character as Ip Man for about four years. How was it?

I started almost 1.5 years before shooting. This was the most enjoyable work with Wong Kar-wai, because before, I never had any information about my character. This time, it's based on a real character, and Kar-wai did a lot of research.

You have a few epic battle scenes, but other times it looks like we're watching you execute choreography.

I didn't feel any violence in the movie after I did all the action scenes. This guy is not trying to kill people [laughs]. He just enjoys the art.

So Ip Man is different.

He didn't look like a kung fu man. He looked like a scholar—very refined, very erudite and graceful. I know he lived a very difficult life, but you can still see the dignity in his eyes. I was wondering, how can a guy live life like that? I think kung fu really inspired him.

Was it difficult to leave the character after playing him for four years?

At the end I really wanted to stop, physically and emotionally. Almost a month before the end, I used to say to Kar-wai on the set, "I cannot do it anymore. I have no more energy." But he looked worse than me. He looked so pale and so sick! I had to go on.

After all this, are you still a Bruce Lee fan?

Now I admire him more, not just as a kung fu great but as a thinker. He's still inspiring me.

How so?

I learned all my knowledge from him, to think like a grandmaster. Learning kung fu was always my dream, and I never had a chance because I was not allowed to learn kung fu when I was a kid. My parents thought was there are only two kinds of people who practiced kung fu: policemen and gangsters. Sometimes in life, if you miss that chance, you will never want to learn kung fu again. I never thought I would learn it after 40-something years.

For more on 'The Grandmaster,' go to Follow @barbarachai on Twitter.