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.


Topics - yo_milo

Pages: [1]
1
Support / [SOLVED] CurrentSprite.GetUntrimmedBounds() Gives wrong center
« on: January 12, 2017, 01:24:07 am »
Greetings, I was converting some code that works with spriteRenderers to work with 2D Toolkit, and there was a section of code that read like:
if(bounds.Contains(position) ){
//Do something
}

However, using 2DToolkit sprites, I figured I should use tk2dSprite.CurrentSprite.GetBounds().Contains(position) or tk2tk2dSprite.GetBounds().Contains(Position), but it was giving me false results :(, and I noticed my bounds.Center parameters were always ceros.

Is there anything I am missing? Should I use the MeshRenderer instead? For the moment I decided to store the bounds in a temporary variable, and then assign the center to my sprite.transform.position.

Is there a 2d toolkit built in parameter that gives me the correct bounds?

Pages: [1]