Help "clipping" fixed-fit-projection (SOLVED)

I have been playing with the Movement Tutorial and one of the optional tasks was stopping the spaceship moving outside the view. So no problem with that, and as part of that I set the render projection to fixed-fit, however I was surprised to see the spaceship being rendered into the black bands:

Looking at the default render script, I think this is caused by setting the viewport to the current window size:

render.set_viewport(0, 0, render.get_window_width(), render.get_window_height())

I assume to get the effect I want (where you see nothing in the black bands) I would need to set the viewport to the display width/height as defined in game.project?

What you want to do can be easily done with Rendercam. We do this in our games, and then use GUI node “blinds” textures at the left and right side, top and bottom sides.

2 Likes

Hey thanks, I’ll look into that!

EDIT: That works really well, thanks, and thanks to @ross.grams for making it and sharing it! Great stuff!