LOS ANGELES – Matthew McConaughey has just cracked open his second Corona when the man wearing Mardi Gras beads and a Village People policeman’s cap approaches his car.

“Do you know Duane?” the inebriated-looking man asks with suspicion, poking his head inside the window and gesturing to the house the car happens to be parked in front of. “Because I’m just giving you a word to the wise. He’s hypersensitive about security and things like that. He’ll have his people come and shake you down.”

It’s 9:30 on a Tuesday night, and McConaughey is sitting in the back of a black SUV with crime novelist Michael Connelly. They’re high above the lights of Los Angeles on a twisty and noiseless street in Laurel Canyon, nursing beers and reflecting on the actor’s role as on-the-make attorney Mickey Haller in the adaptation of Connelly’s “The Lincoln Lawyer.”

Parked down the street from Connelly’s onetime residence — which served as inspiration for Haller’s home — they discuss the building’s distance from the city and how it symbolizes Haller’s status as a legal-system outsider. Neither of them knows Duane.

“You like Mardi Gras?” Connelly deadpans to the 50-ish interloper, who has emerged from a home nearby to offer his unsolicited warning. The man begins an enthusiastic affirmative answer, and Connelly further defuses a fraught situation, saying he used to live up the street, and downshifts to small talk about Beverly D’Angelo, who lives here too. Growing excited, the stranger responds with a semi-coherent story about how D’Angelo has been engaged in a rivalry with actress Carrie Fisher over a role. Then he walks away.

“Well, daa-yam,” McConaughey says in his Texas drawl, laughing as he turns to Connelly. “You could have written a whole novel right there. The Croatian gangsters come, Mickey Haller sorts it all out. Beverly D’Angelo is saved.”

It’s a scene that wouldn’t be out of place in McConaughey’s new legal thriller, with Haller, a small-time lawyer who instead of an office works from a Lincoln Town Car, offering back-seat banter and attitude to clients and antagonists alike. Brad Furman’s Los Angeles-shot and -set film, which opens Friday, examines what happens when Haller is called upon to defend Louis Roulet (Ryan Phillippe), scion of a wealthy Beverly Hills family who’s accused of attempted rape and attempted murder. It’s less a victim tale than a chess match; Roulet is not as innocent as he appears, and Haller soon finds himself in a legal and moral quagmire.

But if McConaughey’s rakish playfulness is evident as he talks about the movie, the part — his first dramatic role after five years of romantic comedies — also has him in a philosophical mood. “With a romantic comedy, the goal is not to hit too hard. It’s a jab. It’s a spar,” McConaughey says. “This is like a Frazier-Ali fight. Ali could have his best day and still lose. This is basic survival.”

It’s also the actor’s first role as a lawyer since his turn as Jake Brigance in “A Time to Kill” vaulted him to stardom 15 years ago, and McConaughey says the onscreen job suits him.

“I always thought I was going to do criminal defense law for a living,” he says. “It’s actually close to the job of an actor or an artist. The defense attorney is a storyteller. He has to weave the web of reasonable doubt, tell the story that could” — he puts his hands together and snakes them through the air — “have happened like this, or could have happened like that.”

Raised in Longview, Texas, McConaughey, 41, spent many years as a favorite of the celebrity media, a poster child for the bachelor life. That changed when he got together with Brazilian TV personality Camila Alves (the couple has two young children). But McConaughey says that it hasn’t been that dramatic a switch. “For me it was a bit of a myth where people go ‘You have kids and your life screeches to a halt,”‘ he says. “You just recalibrate certain things.”

McConaughey took two years off for his family after “Ghosts of Girlfriends Past,” and now wants to delve more into dramas like “Lawyer” and the movies of his early career. (Furman thinks the actor here “gets back to his early signature roles like ‘Dazed and Confused’ and ‘Lone Star’ where he was like Marlon Brando; he was roughneck but he was cool.”)

“I’m more inspired by what I get to do an as actor than I’ve ever been,” McConaughey says. He’s trying to develop several passion projects, including “The Dallas Buyer’s Club,” a 1980s drama about an AIDS patient that several stars have tried to get off the ground.

As the car wends its way down Laurel Canyon and across Sunset Boulevard, the conversation turns to “Lincoln Lawyer” themes. “I like promoting it because there’s something to engage with and talk about. It’s life and death,” McConaughey says.

As for his desire for more dramatic roles, McConaughey takes an Eastern approach. “I think it comes down to that Confucius line: Change the things you can,” he says. “Don’t worry about the things you can’t.”