In “Me and Earl and the Dying Girl,” Pittsburgh high school senior Greg thinks he’s got it all figured out. He glides by all of the social groups — or, as he calls them, the nations — that populate his school. Simultaneously, he’s a member of none of these groups. Greg prides himself on keeping his distance.

Greg does have one friend, though, but he prefers to call this frequent companion a co-worker. His name is Earl and they make movies together. Specializing in parodies of movie classics, they’ve made 42 films. In addition to being an illness drama, Sundance Film Festival favorite “Me and Earl and the Dying Girl” is a self-conscious ode to movies.

Based on the young adult novel by Jesse Andrews and written for the screen by the author, “Me and Earl and the Dying Girl” is this summer’s “The Fault in Our Stars.” While both of these movies are dramas about pending death at a young age, there are substantial differences between the two, including the absence of romance.

Rachel is a girl at Greg’s school who has been diagnosed with leukemia. Greg’s mother, upon learning of Rachel’s illness, asks her son to give the possibly-dying girl a call. It’s a curious request because Greg barely knows Rachel.

The pair’s first meeting is rather confrontational. Rachel tells Greg that she doesn’t want his “stupid” pity. “Just let me hang out with you,” he suggests.

And so their unexpected friendship begins. Greg and Rachel confide in each other. He has low self-esteem.

He expects college to be even more unpleasant than high school. She, on the other hand, is level headed and — mentally, at least — much more well-adjusted than her new, not-sick friend.

But leukemia, chemotherapy and all the misery that come with them inevitably bring Rachel down. “It’s so much harder than I thought it would be,” she tells Greg.

Thomas Mann (“Project X,” “Beautiful Creatures”) plays Greg, the young man who doesn’t want to get involved with his peers, in suitably low-key style. “Me and Earl and the Dying Girl” really is more about Greg and his journey than Rachel and her trial by illness.

It seems selfish that the movie is so much about Greg and his filmmaking. Meanwhile, the bright, formerly happy Rachel suffers beneath the heavy cloud of a potentially fatal disease.

Playing Rachel, Olivia Cooke (“Bates Motel,” “Ouija”) initially delivers as the “Me and Earl” character with so much to lose. But there’s not enough of Rachel and her journey, an experience that’s obviously much more profound than whatever Greg is experiencing.

Following Greg’s mother’s suggestion that he befriend Rachel, Madison, the most popular girl at school, gets into the act when she tells Greg that he and Earl, played no nonsense-style by R.J. Cyler, should make a movie for and, inevitably, about Rachel. It’s another example in the script of Greg being told by someone what he should be doing.

Often opting for a nonchalant tone that adheres to Greg’s own detached approach to life, “Me and Earl and the Dying Girl” eventually faces the music. The huge, jolting shift in atmosphere isn’t as convincing or moving as it might have been.

The story is a largely casual trek to Greg’s self-discovery that doesn’t adequately prepare the way to big drama and emotion. On screen, the usually in-denial Greg may lurch his way into actually feeling something. But audiences may not.