Is it possible to draw on an SFML window regardless of views?

483 views Asked by At

I have a game I'm currently working on, and it uses multiple views (for a minimap for example).

Thing is, I would like to have a fading effect added at some point, so I thought I'd create a black image that is the size of the screen and change its alpha value with a timer. That part is not a problem.

What happens right now is the main area (ie window default view) is fading (because the opacity of the image is increasing), but the minimap (minimap view) is unaffected. This is normal behaviour for views, but is there a way to draw an image to the whole window, regardless of the views ?

Thanks in advance

1

There are 1 answers

1
xxAtrain223 On

To clarify, you have the default view where you'll draw the main game, then you'll have the minimap view where you would draw the minimap. At some point in the game you want the whole screen to fade to black. It sounds like you've been trying to draw a black image on the default view (changing the alpha) to make this effect work.

So, you need a third view that you draw your black image on to get this fading effect.