Producer Dan Lin got the idea to make a movie involving Lego after watching his son construct elaborate fantasy worlds. “He was talking to his Lego [toys] as he played with them,” says Lin. “There was such a grand adventure taking place in his mind.”

Last weekend, Warner Bros.’ “The Lego Batman Movie,” the latest installment in the family film franchise, opened in theaters, doing a smashing $55.6 million at the box office. Unlike 2014’s “The Lego Movie,” this spinoff will unfold in the widest screens of all — Imax.

“We’re trying to capture kids’ imaginations,” says Lin. “We want these worlds to be immersive, and showing these films in Imax helps with that.”

Getting to this point required a course correction. Imax turned down the first Lego movie and has declined to show other animated and family-skewing titles, believing them too far removed from its core fanboy audience.

While becoming the de facto choice for “Star Wars” adventures and live- action comic-book adaptations, Imax has more or less ignored movies plugged at young children.

“Over the last couple of years we have missed some titles that we regret,” says Greg Foster, CEO of Imax Entertainment. “We made a line-in-the-sand decision not to do family-oriented titles, and that has been a mistake.”

No longer. This year, Imax has committed to showing another spinoff, “The Lego Ninjago Movie” with Jackie Chan, and Disney’s live-action version of “Beauty and the Beast.” At least two other family titles will be offered, Imax says, declining to release names.

The pivot comes as studios are investing heavily in cartoon and CGI properties.

NBCUniversal, for instance, shelled out nearly $4 billion last year to buy DreamWorks Animation, and Sony, Paramount, and Warner have spent millions ratcheting up their animation divisions. Audiences like what they’re selling: Five of the 11 top-grossing domestic releases in 2016 were animated — a group that includes “Zootopia,” “Sing,” and “Finding Dory.”

“We’re ultimately responding to the marketplace,” says Foster. “We need to play these blockbusters. It’s a business we need to be a part of.”

But Jeff Bock, an analyst with Exhibitor Relations, questions whether families will shell out extra to see films in Imax. The company typically charges $5 to $6 more than the average ticket price; 3D films cost an additional $2 or so. Other so-called premium formats have not done well among moviegoers with kids, because of both the higher price and youngsters’ discomfort with wearing 3D glasses.

“You’re talking about four tickets costing you $80,” Bock notes. “If you have a lot of discretionary cash, all right. But it’s like buying the biggest car — does it give you more mileage?”

Imax does seem to be making concessions to audiences’ desire to economize. Domestically, Imax showings will be almost exclusively in 2D.

While Imax touts its shift to family fare, Warner Bros. argues that “The Lego Batman Movie” is for more than just kids. “It’s not only for 8-year-olds; we’re going to get 18-year-olds, 38-year-olds, and probably 88-year-olds,” says Jeff Goldstein, president of domestic distribution. “There’s enough hip and cool stuff and humor for older audiences.”

In the past, Imax has sometimes swapped in family films in their second or third weeks of release for superhero or
sci-fi titles that have faltered. Going forward, the company wants to be part of movies earlier in the process, allowing the studios to highlight Imax in posters and television spots.

Lin, too, sees an advantage in partnering with Imax on the ground floor of future Lego movies. He hopes to one day use Imax cameras to shoot sequences, just as Christopher Nolan and J.J. Abrams did on “The Dark Knight” and “Star Wars: The Force Awakens,” respectively.

“That’s the dream,” Lin says. “But first we have to convince the studio to let us.”