Nevermind I fixed it. Thanks to all of you.
I appreciate your constant efforts to help, you all are very nice people.
Thanks.
Btw heres the part of the code for future reference
text.setString("test");
text.setPosition(W_WIDTH/2.0f,W_HEIGHT/2.0f); //Window width divided by 2, same with height.
text.setOrigin(text.getLocalBounds().width/2.0f,text.getLocalBounds().height/2.0f);