Get up.

That was the thought in Rudy Gay’s mind as he lay prone on the floor of Sacramento’s sparkling new Golden1 Center last January.

First demanding his now useless left leg to work, then begging.

Get up. Please.

When it became apparent his body was not able to comply, Gay did the only thing left to do.

He cried.

“I just broke down,” Gay recalls now.

That was the first memory Gay has of the night of Jan. 18, when he shredded his left Achilles tendon in the third quarter of a Kings loss to Indiana.

“It was probably the scariest moment of my career,” Gay said. “I never imagined something like that could happen.”

His 11th NBA season was over after only 30 games.

He couldn’t even walk off the court under his own power. He had to be carried.

It took Gay two days of soul-searching and moping and feeling sorry for himself before he came to a conclusion.

This would not be the end of him. This could be a new beginning.

Having signed a two-year, $17 million deal earlier this month to resurrect his career with the Spurs, Gay arrives in San Antonio this week with a renewed purpose.

His goals are not small.

“I’m going to have the best comeback ever,” Gay said. “That’s the motivation of it.”

From his rookie season of 2006-07 until the moment he collapsed in a heap against the Pacers, Gay had been renowned as one of the better wing scorers in the league.

Playing for Memphis, Toronto and Sacramento, the 6-foot-8 forward averaged at least 19 points six times between 2007 and 2015.

He is only two seasons removed from putting up a career-best 21.1 points per game with the Kings.

Gay’s best statistical seasons came with Sacramento, where he averaged 19.4 points in four seasons.

He was also largely miserable there.

Fed up with losing and a team culture he calls “mentally draining,” Gay decided to decline an option worth $14 million to return to the Kings next season.

It is a decision he stuck by, even with his Achilles tendon in tatters and his future uncertain.

“I was numb to the situation I was in (in Sacramento),” Gay said. “It took a lot out of me.”

For peace of mind, Gay was willing to take a pay cut. The moment he signed with the Spurs last week, he said, felt like a liberation.

“As soon as I signed the contract,” Gay said, “a dark cloud wiped away.”

In San Antonio, Gay joins an organization with a record of professionalism and consistency unsurpassed in sports.

The Spurs have made the playoffs 20 consecutive seasons. With coach Gregg Popovich at the helm for two decades, San Antonio has become a comfortable landing spot for veterans who prefer to spend their 30s apart from the drama that often infects other NBA locker rooms.

In four seasons with Sacramento, Gay played for four coaches.

“Team and winning,” Gay said, describing his attraction to the Spurs. “I think you already know, when you talk about the Spurs, there’s a certain respect you get. I want to be a part of that.”

Gay also received interest this summer from Oklahoma City, the Los Angeles Clippers, Miami and Brooklyn.

He said a phone call with Popovich late in his free agency process helped seal the deal.

“After talking to him, it was a no-brainer,” said Gay, who turns 31 in August. “Everybody says the same thing. A lot of teams in the league are lacking that structure. He promotes it.”

In Gay, the Spurs are getting a player whose interests extend beyond the hardwood.

He and his wife, Ecko, have two boys — a 3-year-old, Clinton, and a 1-year-old named Dean.

One of his last acts before relocating to San Antonio for the summer was a family outing to the Major League Baseball home run derby in Miami.

An unabashed shoe head and self-admitted fashionista, Gay has been named one of the NBA’s best-dressed players by Men’s Fitness magazine.

His interest in style stems from a childhood in Baltimore when he couldn’t always afford to dress the way he preferred.

“It came from watching TV and not being able to afford anything,” Gay said. “I knew when I grew up, I was going to buy what I wanted. Same with tennis shoes.”

Gay estimates his shoe collection reaches into the thousands.

“I have a pretty big closet,” he said with a laugh.

For now, Gay’s focus is on the court — on, in his words, “trying to get back to where I was.”

It took six weeks after his injury before he was able to walk again. He has been back to full basketball activities for a little more than a month.

Early in the recovery process, Gay spoke to Kobe Bryant, who suffered the same injury in April 2013.

“He said you have to train like a maniac,” Gay said.

Gay has been pleased with the results of his rehabilitation. Now it is time to rehab his career.

“Physically, I’m my old self,” he said. “I’m cleared to play. The only thing that can help me now is to play.”

That will come soon enough.

Gay can’t be sure precisely what the future holds. For the first time in a long time, however, he is optimistic.

“I’m excited about the possibilities,” Gay said.

When could a torn Achilles tendon be considered a blessing in disguise? When it gives you new life.

Six months ago, Gay laid on the court in Sacramento, pleading with his body to get up. At last, in San Antonio, he has a reason.