ORLANDO, Fla. – At Universal Orlando, visitors can buy mugs of butterbeer pulled straight from the pages of the “Harry Potter” books — or eat Krusty Burgers made infamous by “The Simpsons” television show.

At Walt Disney World, they can sample LeFou’s Brew or The Grey Stuff, a drink and a dessert inspired by the animated film “Beauty and the Beast.”

And now, at SeaWorld Orlando, they can sip on South Pole Chill amid the glaciers of Antarctica.

It’s the latest attractions arms race. Though Orlando’s theme parks have for years tried to top one another with sophisticated rides and shows, the battlefield today extends to food and merchandise, too. Comcast Corp., Walt Disney Co. and SeaWorld Entertainment Inc. are all investing in more immersive restaurants and shops, and devising new lines of custom products.

As Comcast’s Universal proved with the Wizarding World of Harry Potter — which has made drinking a butterbeer as much a must-do for Orlando tourists as riding Space Mountain — finding the right formula can lead to big gains in guest spending.

And that’s vital for a maturing U.S. theme-park industry, where boosting attendance and extending vacations becomes more challenging every year.

“While overall theme-park attendance is growing, the rate remains in the low single digits. So to grow faster than inflation without big capital spending, you need to get more out of the customers you have,” said Bob Boyd, a leisure analyst with Pacific Asset Management.

Another factor is the skyrocketing cost of intellectual property as theme parks compete for the rights to fictional characters and worlds — from Harry Potter, “Star Wars” and “Avatar” to the as-yet unsecured “Lord of the Rings” — that can underpin new attractions.

“There isn’t a lot of really good intellectual property out there, and what is available is expensive,” Boyd said. “So you need to get everything you can out of what you have.”

The industry’s emphasis on theme-based retail is a shift from just a few years ago. Throughout much of the 2000s, theme parks culled, rather than expanded, their product lines, the better to improve their purchasing power and wring savings out of suppliers.

Industry-leader Disney, for instance, eliminated items such as hotel-specific Christmas ornaments. Instead, it began introducing more “Disney Parks”-branded merchandise that could be sold at both Disney World and Disneyland in Anaheim, Calif.

“I would say that as far as the shopping — and especially the dining — they were underselling and underestimating the customer,” said Abe Pizam, dean of the University of Central Florida’s Rosen College of Hospitality Management.

Then came the Wizarding World of Harry Potter in Universal’s Islands of Adventure. In addition to the obligatory rides and shows, Universal built a collection of intricately detailed shops and eateries, all based on locations from the Potter books and movies — and all selling custom-designed items based on the same material, from chocolate frogs to golden snitches.

The results stunned the industry. When Wizarding World opened in June 2010, the lines to get into the stores often surpassed the queues for the rides. Per-visitor spending on food and souvenirs at Universal Orlando jumped nearly 30 percent in just the first year, from less than $20 to almost $26.

Per-guest ticket sales, by contrast, rose 11 percent to $57.

Comcast and Universal are now racing to duplicate that success elsewhere. A direct descendant of Wizarding World is Springfield, the hometown in “The Simpsons,” which Universal is now building at Universal Studios Florida. When completed, the area will include more than a half-dozen stores and restaurants based on favorite locations in the satirical show.

Some of the eateries, including Krusty Burger and Moe’s Tavern, opened earlier this month and began selling Krusty Burger platters, chicken-thumb baskets and Duff Beer to wash it all down.