Keeping crosshairs & GUI onscreen - SFML

Posted by nihohit on Game Development See other posts from Game Development or by nihohit
Published on 2012-04-16T08:50:46Z Indexed on 2012/04/16 11:46 UTC
Read the original article Hit count: 545

Filed under:
|

I read this question, but didn't understand the implementation suggestions with SFML on c#.

For example, right now I'm just trying to make sure that the mouse crosshairs stay onscreen constatnly. I tried using this code:

        View lastView = this._mainWindow.GetView();
        this._mainWindow.SetView(this._mainWindow.DefaultView);
        this._mainWindow.Draw(crosshair);
        this._mainWindow.SetView(lastView);

after drawing all other sprites and before call this._mainWindow.display(), when beforehand I set crosshair.Position based on its position relative to the window, not the view. This just keeps the screen locked and prevents screen scrolling. Any suggestions?

© Game Development or respective owner

Related posts about gui

Related posts about sfml