2D Toolkit Forum
2D Toolkit => Support => Topic started by: pedronveloso on November 11, 2013, 03:01:55 pm
-
I'm doing a top down game and I'm using a lot of sprites on top of other sprites (background, terrain, terrain details, characters) etc. Any special recommendations to this use-case?
1. There are big chuncks of the background that all belong to the same atlas and in runtime I've to change the color of each of this sprites dynamically. Do I still have some advantage by creating a Static Sprite Batcher since they all come from the same atlas, or does the fact that I'm tinting the color of each sprite to a different value makes SSB useless?
2. This same chunks are map areas on my game, and I just need to be able to click on them. I've created polygon mesh for all of them, and selected Collider Cap = Front because I don't need the back. But I also don't need to detect collisions between the area maps themselves, just need to handle clicks (or touch events on case of mobile) on them. Is there a way to cap so that I only have "Front" and not the lateral collider that is typically needed for say side-scrollers ?
Thks in advance
-
1. If you change the tints of the sprites dynamically every frame, then the SSB won't be a good choice here. Its quick to build though and you'll break even at some point with 1 SSB vs many sprites.
2. No. Just flag them not to collide with each other or anything else in the physics collider mask setup and that should sort it out.
-
1. If I place them in a SSB the SSB rebuild happens automatically during runtime everytime I re-tint my sprintes, or do I have to trigger it via code?
2. That's what I'm currently doing already. Thanks :)
-
1. You have to update the SSB in code manually. The individual sprite game objects won't exist at runtime.