Simple Question: Offset Camera (canvas?)
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Simple Question: Offset Camera (canvas?)
I'm trying to create a game where the playing field takes up a square in the right of the screen. I want to use a camera to zoom in and out, but the playing field isn't centered in the screen. Do I have to use canvases for this? I'm trying to avoid that, but if it's the simplest most efficient way then I can live with it.
Re: Simple Question: Offset Camera (canvas?)
You don't have to use canvases for this. You can do one of two things: look for a camera lib. or make your own. If you want to make your own you will have to have this code:
Look at the `coordinate System` section of the love.graphics.wiki for more info.
Code: Select all
love.graphics.draw()
love.graphics.push()
whatever()
love.graphics.pop()
end
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Re: Simple Question: Offset Camera (canvas?)
Well, now I feel dumb. I was using the HUMP camera, I just added love.graphics.translate before drawing with the camera and presto. Thanks.
Re: Simple Question: Offset Camera (canvas?)
No problem. You wouldn't believe how many 'wow I feel dumb now' moments I've had recently.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Who is online
Users browsing this forum: Google [Bot] and 3 guests