2D Toolkit Forum

2D Toolkit => Support => Topic started by: mamamia on January 15, 2013, 11:42:09 pm

Title: Rendering just part of scene through camera cull mask?
Post by: mamamia on January 15, 2013, 11:42:09 pm
Hi!,

I'm implementing a scrollable list. I would like to have a camera showing all my scene (this camera shows all 960x640 native resolution pixels). And to do the clipping of the scrollable list I have though about using a second camera that just shows the items. How can I achieve this? I mean, can I make a camera just show a 500 pixels wide x 400 tall on my 960x640 scene? This 500x400 zone is the zone where my items will be shown and the camera must simulate the clipping of the items when outside this zone. Is it possible?

Thanks in advance.
Title: Re: Rendering just part of scene through camera cull mask?
Post by: zeStudio on January 16, 2013, 06:24:38 am
What is in the rest of you scene?

Why not just overlay another sprite in front of it which is aligned to the scene behind it?

It would be pretty neat to have a clipping mask feature though.
Title: Re: Rendering just part of scene through camera cull mask?
Post by: mamamia on January 16, 2013, 08:06:59 am
Hi!,

I would like to avoid the overlay solution because I want to create a list that could work in any situation and any scene. If I understood you, the overlay option implies to craft for every situation some sprites aligned with the background that will cover the part of the list that is out the clipping zone.

I would really love to have a more general solution, and I think it cam be accomplished with camera culling layers, but will wait for unikron to confirm.

Thanks in advance.
Title: Re: Rendering just part of scene through camera cull mask?
Post by: unikronsoftware on January 16, 2013, 12:41:20 pm
You can multiple cameras, culling layers and the viewport rect, but you will need to manually compensate the camera size in both a normal ortho camera and the tk2dCamera. I've got a sample which I can send to you using normal ortho cameras - drop me an email to support@unikronsoftware.com and I'll send it your way.
Title: Re: Rendering just part of scene through camera cull mask?
Post by: NaiDriftlin on January 16, 2013, 05:23:22 pm
I wouldn't mind seeing this as well.    Mind if I e-mail you for the same?
Title: Re: Rendering just part of scene through camera cull mask?
Post by: unikronsoftware on January 16, 2013, 05:24:43 pm
Sure no problem.