SFML 2.0 Text scrolling

I have screen scrolling working but i want to have text scroll with the screen. because at the moment my player moves and the screen scrolls but the text doesn't.
hello?
Text has a position like everything else; you'll have move it along if you want it to follow the screen.
can i have an implementation
screen moved
move text by same amount
Implementation in code
Just add the velocity of the camera to the text x & y coordinates.
Your question is vague to the point of uselessness and I suspect you could find your answer by googling a sufficiently non-vague set of search terms.
Well i tried doing that in various ways . but i am getting errors .

intially i i wrote

Code: [Select]


while (Text.Position() ! = 100 )
Text.Move( 0 ,App.GetFrameTime() * SCROLL_SPEED) ;


I mean , i wanted the scrolling to take place till a certain position

but how do i get to know the position ? I was going through the documentation , but could understand much from it.
has anyone got it to work
ok let me change the question. does anyone know how to make text stay on the screen regardless of if the screen scrolls
It depends on how the screen is scrolling.
it scrolls along a background when the players x/y co-ordinates are in the centre of the screen.
and i want it to be stuck to the view not the screen
You can set the position of the text relative to the view, then.
Assuming you have your RenderTarget and a Text object to draw, just something like:
1
2
3
// set to very top left of the view
text.setPostion(target.getView().getCenter().x - target.getView().getSize().x/2,
                target.getView().getCenter().y - target.getView().getSize().y/2);
THANK YOU!!!!!!! :)
Topic archived. No new replies allowed.