Tracy McGrady ignored the boos and the angry crowd. He just played hard — and won.

Playing in Orlando for the first time since a bitter parting last summer, McGrady scored 27 points to lead a balanced offense and the Houston Rockets beat the Magic 108-99 on Thursday night.

“I was so focused,” said McGrady, winner of two scoring titles in four seasons with Orlando. “I knew the reception I was going to get, but while I was out on the basketball court I was just trying to find ways to get myself going and make my team better.”

Unlike his time in Orlando, when McGrady was often the Magic’s first, last and only scoring option, his Rockets teammates can help — and he is willing to lean on them.

Yao Ming added 20 points, and Bob Sura had 19 points, a season-high 11 rebounds and nine assists. David Wesley scored 18, and Juwan Howard 13.

“I didn’t want to come out and make it a Tracy McGrady show, jacking up shots and playing outside the offense,” said McGrady, who shot 8-of-21, including 1-for-7 on 3-pointers, but made 10 of 12 free throws.