UNTIL FAIRLY RECENTLY, the rule of thumb for gay-themed films seemed to be that if gay male characters pass as straight, it's drama; if straight characters play gay, it's comedy. Or at least what passed for comedy at the time. In The Gay Deceivers (1969), two hunky heteros are forced to "live like gays" in order to avoid the draft, moving into a condo laden with frilly curtains. The execrable Partners (1982), a sort of Cruising-lite, depicts macho-straight-cop Ryan O'Neal living with limp-wristed closet case John Hurt as a "couple," while tracking a serial killer who's murdering gays.

In a scenario that can so easily become offensive, how do you avoid the pitfalls? In Happy, Texas, it's very simple. It's not the scenario of straights playing gay that provides the comedy; it's the characters themselves.

"Even though when you describe the movie, you say, 'It's about these guys and this pageant,' that's really not what the movie's about," says Ed Stone, who co-wrote the film with first-time director Mark Illsley and Phil Reeves. "It's really about the relationships, and how they change. The pageant's just the backdrop. It's the flimsy plot line that holds it together!"

The film begins with an inadvertent jailbreak in west Texas, when the police van carrying Harry (Jeremy Northam) and his half-a-tank-short buddy Wayne (Steve Zahn) meets with an accident. The two steal a mobile home which breaks down outside the tiny town of Happy where, oddly, everyone seems to expect them. Rummaging through the mobile home in search of their identities, they discover they're a gay couple whose business is pageants. They've been hired to help the town's grade-school pageant wannabes brush up on pageant etiquette. The two decide to rob the local bank, and so they play along with the townspeople, planning their heist for Pageant Day.

Ah, but those eternal complications. Harry falls for the bank owner, "Joe" (for Josephine; Ally Walker), while Sheriff Chappy Dent (William H. Macy) takes an unexpected shine to Harry. In one of the film's best scenes, the two men go out on a date, to Happy's equivalent of the Timberline. Harry's initially ill at ease, but eventually relaxes and ends up having a pretty good time -- even hitting the dance floor with Chappy.

Stone came up with the film's story based on his DJ experience in a town near the real Happy. "There was a pageant in Plainview," he remembers, "and the pageant people had flown in this woman from Mississippi for a huge amount of money, because the girls weren't curtsying correctly. And I was like, 'That's the stupidest thing I've ever heard.' So I made fun of them on the air -- which was a horrible mistake!"

Stone and Illsley made a conscious effort not to let the humor in their script become mean-spirited. "Guys walking around playing it really broad just didn't appeal to us," says Illsley. "We weren't trying to make fun of people. And I think when you go around trying to imitate somebody in a really broad 'gay' gesture, you're making fun of them. Most of the town presumes they're gay just because they are said to be; 'I've heard they're that way, they must be that way.' We were more interested in playing that up."

"And Wayne, he doesn't change his behavior one iota," Stone adds. "But as he falls in love with the [pageant] girls and starts accepting responsibility, it softens him. He becomes the den mother." Wayne's transformation makes his character a total delight. He looks more uncomfortable when he meets the pageant wannabes than Harry does on his date with Chappy. But as he bonds with his charges, his earnest slowness becomes a dogged determination to see "his girls" succeed. It's no surprise that Zahn won a Special Jury Prize for Comedic Performance when the film played this year's Sundance festival.

Zahn might have ended up stealing the film (Northam's character is the ostensible focal point) if it weren't for Macy's sweet, sincere Chappy. In spite of the character originally being written as "a big John Goodman/Ned Beatty kind of guy," Macy's agent asked if they'd consider him for the role. Stone's first reaction was, "'No! He's a skinny guy! Didn't you read the script?' But Mark was like, 'Are we out of our minds?'" Wisdom prevailed, and Macy was signed. "I'm really proud to say [that] when I watch the movie now, it looks like the part was written for Bill Macy."

There's no deep message; Happy, Texas is simply "about characters finding each other and not finding each other," says Stone. And the fun comes in laughing with, not at, these characters.