Clipping / Masking

7 replies [Last post]
Chman
User offline. Last seen 34 weeks 1 day ago. Offline
Joined: 28 Jan 2010

Hi,

I looked through the doc to see if it was available, but it's not (correct me I'm wrong). It'd be nice to have some clipping functions, like a mask in flash.

Basically something like this :

1
2
3
4
local clip_rect = display.newClipRect(50, 50, 100, 100);
 
local circle = display.newCircle(60, 60, 80);
circle:setClip(clip_rect);

A polygon shape could be *very* helpful in this case. I don't know how hard it'd be to add this feature into Corona, especially using OpenGL. There's glScissor but it's only for static rectangle (can't be rotated from what I know).

Tom

Replies

OderWat
User offline. Last seen 28 weeks 15 hours ago. Offline
Joined: 4 Jun 2010

I want this too! Already wondered why that is not implemented yet...

How can one scroll something inside a rect on screen!? Or do I miss something?

MarkHenryC
User offline. Last seen 5 weeks 2 hours ago. Offline
Joined: 11 Nov 2009

I third that. Clipping masks would be great.

This is no substitute for such, but in some cases it could be handy: a way to scroll an image within an arbitrary window.

WindowScroller

NOTE: requires game SDK as it uses spritesheets.

tetu
User offline. Last seen 5 days 13 hours ago. Offline
Joined: 3 May 2010

i fourth that.

i've seen amazing things made with masks in Flash. without even writing a single line of code. well, Flash has an IDE and lets you designate a layer as a mask layer. but a property like displayObject.mask=anotherDisplayObject would be great to have.

jmp909
User offline. Last seen 7 weeks 2 days ago. Offline
Joined: 14 May 2010

also suggested here.. http://developer.anscamobile.com/forum/2010/10/05/mask-capture-image

apparently something like that is coming.. :)

binarymoon
User offline. Last seen 18 weeks 11 hours ago. Offline
Joined: 22 Oct 2010

This would be great. Using it for simple things like energy bars would be a big help. I'm sure others could use it for more.

PatrickDadzio
User offline. Last seen 2 weeks 6 days ago. Offline
Joined: 31 Jan 2010

Any news on masking?

f2cx
User offline. Last seen 1 week 5 days ago. Offline
Joined: 13 Sep 2010

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.