Page 1 of 1

Split screen in Love

Posted: Mon Mar 12, 2012 5:01 pm
by Arthes
Hello.
How to do split screen for two players in Love2D?
Thanks for replies.

Re: Split screen in Love

Posted: Mon Mar 12, 2012 5:11 pm
by trubblegum
You probably want some of this : https://love2d.org/wiki/love.graphics.newFramebuffer

Beyond that, it would be dependent on what kind of game it is.
You could be looking at anything from simply rendering a scene from two different perspectives to creating two instances of your world state.

Re: Split screen in Love

Posted: Mon Mar 12, 2012 5:20 pm
by Robin

Re: Split screen in Love

Posted: Mon Mar 12, 2012 7:28 pm
by coffee
Both commands can help do it but actually we can do split screens quite well with using any of the any of indicated instructions. Draw only a "viewport" or two don't matter much. We just need to detect screen size, calculates how many space to reserve to each player and instead draw a big screen, draw a smaller portion for one and for another starting with other map x/y coordinates just bellow or at right. A method/technique that could be applied (or not) is resize each player viewport if is needed to see the same number of spaces (or aspect ratio) than in 1p mode and not let's say half "map".

What I'm trying to say is that you won't great science for 2p split screen because it will be using eventually the same processes as 1p or bigger screen. Just need draw twice and smaller.

Re: Split screen in Love

Posted: Mon Mar 12, 2012 7:39 pm
by T-Bone
If you know how to make a single-screen LÖVE game, then all you need is probably love.graphics.setScissor. Programming of graphics can be simplified with love.graphics.translate as well.