If anyone is interested in a solution, I setup something like:
sf::View Camera;
sf::View HUD;
...
App.SetView(Camera);
App.Draw(...objects impacted by the camera);
...
App.SetView(HUD);
App.Draw(...objects not impacted by the camera);
------------------------------
Original Post:
------------------------------
Currently I'm caping the framerate with:
App.SetFramerateLimit(200);
I was really trying not to impose a limit, but it was proving much work to make everything consistent for everyone, even when using
float offset;
...
offset = App.GetFrameTime() * 0.05f;
Anyways, whenever I didn't have a framerate limit, it seems that the HUD stayed in place better. Currently with the framerate limit, the HUD moves a little bit to the right or left whenever the character moves, or slightly up and down whenever the character jumps. Here's what I'm currently using to keep it in position (just an example):
hud.SetPosition(Camera.GetCenter().x - 445, Camera.GetCenter().y - 295);
I also tried experimenting with setting the hud's position after the App.SetView(Camera); method, but the result is the same.
How do you guys like to ensure that your HUD doesn't move around?
Thanks for any help!