Add clipping!

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
Borsty
Citizen
Posts: 66
Joined: Sun Oct 19, 2008 10:29 pm
Location: Hamburg, Germany
Contact:

Add clipping!

Post by Borsty »

Problem solved :P
Last edited by Borsty on Wed Nov 12, 2008 1:11 pm, edited 1 time in total.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Add clipping!

Post by bartbes »

Aren't you looking for setScissor?
User avatar
Borsty
Citizen
Posts: 66
Joined: Sun Oct 19, 2008 10:29 pm
Location: Hamburg, Germany
Contact:

Re: Add clipping!

Post by Borsty »

Oh lol, must've slept when I read through the docs :C

Thanks! :P
User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Re: Add clipping!

Post by mike »

Just out of curiosity: What are you using it for?
Now posting IN STEREO (where available)
User avatar
Borsty
Citizen
Posts: 66
Joined: Sun Oct 19, 2008 10:29 pm
Location: Hamburg, Germany
Contact:

Re: Add clipping!

Post by Borsty »

http://love2d.org/forum/viewtopic.php?f=5&t=257

For some of the controls, ie the edit control.
User avatar
Dr. Magnusson
Prole
Posts: 22
Joined: Sun Jul 20, 2008 6:10 pm

Re: Add clipping!

Post by Dr. Magnusson »

It'd be nice to several scissors, if possible.

Like, if I had a button with text on it, it'd be nice if I could scissor both the button and the window the button is in.
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Add clipping!

Post by rude »

That can be done like this:

Code: Select all

window:draw()
love.graphics.setScissor(window:getBox())
window.button:draw()
love.graphics.setScissor(window.button:getBox())
window.button.label:draw()
love.graphics.setScissor() -- Disables scissor.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests