Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - nindim

Pages: [1]
1
Support / Re: Automatically transfer a sprite between atlases?
« on: September 30, 2015, 04:35:40 am »
I know this is an old post, but I need to do the exact same thing as wiley.a...

Uikron, you mentioned perhaps supporting this officially, did that ever gain any traction? Seems like it would be a really useful feature!

2
Support / Re: Repeating Sprite In Atlas
« on: January 21, 2015, 11:00:24 pm »
Given that you're talking about memory constraints, I guess you calculate the trimming just in time as you build the sprite collection and its never saved out to the SC prefab?

I was thinking the trim information would be available to simply be referenced when the linked collection was to be built. Saved per sprite in the collection or something... Actually, given that when you instantiate a sprite it includes the empty space outside the render mesh that was trimmed away, this information must exist somewhere?

As an aside, I tend to limit myself to 2048 anyway, 4096 textures aren't supported on all my target platforms at this point.

3
Support / Re: Repeating Sprite In Atlas
« on: January 20, 2015, 10:03:52 am »
Regarding the restriction on tiled sprites, that's a shame. My use case is only in editor so the speed wouldn't really matter to me. I understand your predicament though. For simple shapes like boxes I can create a script that matches the tiled sprite's geometry bounds with an inset value to ignore the alpha,hopefully I don't get asked to tile anything that requires a more complicated collision polygon.

The trimmed box collider matching the trimmed sprite in the atlas makes sense, I am using linked SpriteColelctions (for NormalMaps) which don't support trimming so the box colider includes my alpha.

It would be great if linked SpriteCollections would use trimming identical to the master collection. For normal maps this would be perfect given that the diffuse and normal maps will have the same bounds. This would potentially save lots of texture space. Not sure how difficult this would be to achieve though, is the master collection's trimming information available to the linked collection at build time?

4
Support / Re: Repeating Sprite In Atlas
« on: January 17, 2015, 02:18:21 pm »
Hi,

Yes, I somehow forgot this existed even though I have used it before in my project...   :-[

I have now started using it on a sprite that has a collider specified in the SpriteCollection, unfortunately the collider does not generate in the scene instance, I was expecting it to generate colliders as though I had just placed many of the normal tk2dSprites next to each other.

I am using this for items like railings that act as one way platforms. I had intended to use a single polygon for the collision with the normal facing upwards.

The option to Create a box collider does not seem to do what the manual suggests:

"Create Box Collider - If ticked, a tight fitting box collider will be created around this sprite. You can adjust the collider depth on the collider itself."

When ticking this box, the collider that is being created for my object also includes the transparency around the object, I had expected it to only include the bounds of pixels with an alpha greater than zero.

The box collider not being tight fitting could be  a more general bug, selecting Box Trimmed on the sprite in the sprite collection doesn't actually seem to trim the transparent area away at all for normal sprites.

Let me know if you need more information.

Thanks,

Niall

5
Support / Repeating Sprite In Atlas
« on: January 15, 2015, 07:52:15 pm »
Hi,

Is there any functionality I haven't found to create a repeating sprite while also using a texture atlas?

Making the sprite double the width would work in the same way as having the texture co-ords go from 0-2 on the X-axis and having the texture set to repeat mode.

I think the only way this could be achieved is by creating multiple quads with individual vertices and UVs and texture mapping from 0-1 for each quad, or 0 to something less than 1 if the size wasn't an exact multiple (an option to have the Uvs all stretch/squash a little to mantain the full sprite on each quad even though the aspect ratio isn't quite right would be nice as well. I recently did this for the edge mesh on a terrain editor and it worked very well.

So, does this already exist in 2D Toolkit? If not, I think it would make a great new feature.

Thanks,

Niall

Pages: [1]