Stencils and graphics.translate

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Stencils and graphics.translate

Post by Plu »

I'm working on a game for the global game jam (wooh!) and right now I've run into a little problem with Stencils, I was hoping someone would be able to help.

Basically I have a Stencil that should always be on the viewport (like a GUI element) while the level behind it is translated around with love.graphics.translate. However, there seem to be some problems. If I include the stencils in the translation then (obviously) they also get translated around, and they're no longer centered.
But if I disable the translations before running the stencil function, then the stencil is rendered in the right place but it appears that the draw operations to the stencil are applied improperly; my stencil has two circles in it and while the circles remain in the center of the screen they get cut off at the top or bottom (depending on which way I translate). It seems the stencil is exactly as large as the viewport, and I'm unable to properly draw to it?

Anyone have any idea why this is happening and how I could get around it?
Post Reply

Who is online

Users browsing this forum: Google [Bot], slime and 62 guests