2D Toolkit Forum
2D Toolkit => Support => Topic started by: Tongie on September 25, 2012, 05:23:08 pm
-
for spritecollection I selected
Anchor : Middle center
Coliider Type : box custom
Max X :1000
MaxY :2000
but the sprite is always at the upperLeft(Top left corner of the collider) how do I put the sprite in the centre of the collider? I change the center x and y in box collider but it always change back to the original.
-
So are you trying to create a collider which is much bigger than the sprite? The collider is only allowed to be as big as the sprite itself. You could make your sprite bigger with more empty space in it - this will get trimmed out so theres no loss really.
-
ya but the collider can be created but the sprite is always at the top left corner. I want it to be at the center of the collider this the picture shown below. Anyway to do it?
-
You'll need to pad out the image, add a transparent border. If the image is only 40x40, and the collider is 80x80, it's always going to display the image as 40x40. Make the canvas of the image the same as the collider size, that'll fix the issue. There might be a feature to add padding to the image by default, not sure ain't on a computer with TK2D installed.
-
If its just ONE sprite, then you could just set collider type to Unset, and build it yourself in the Unity interface. The nice thing is that this is all flexible, you have a lot of options on how to go about it.