Hello Guest

Author Topic: Anchors and Colliders on Textures in % instead of pixels.  (Read 4557 times)

robin.fischer

  • Newbie
  • *
  • Posts: 2
    • View Profile
Anchors and Colliders on Textures in % instead of pixels.
« on: November 22, 2013, 05:36:08 pm »
Hi 2DToolkit Team,

thank you for the great Work. :)

My Problem is that the Information for Colliders and Anchor Points which is set in the Sprite Collection Popup, are saved in Pixels.
This would be fine if this information would consider the PixelToUnit Ratio.

When I swap my Graphics to a higher Resolution (e.g. @2x for iPad Retina) all the Atlases get rebuild with the higher Textures. This is great, but all the Anchor Points and Collider Settings are still mapped to the Pixel Values of the small Textures.

Is there a way to set this? And if no, could you please implement it? :)


Thank you.

Robin

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Anchors and Colliders on Textures in % instead of pixels.
« Reply #1 on: November 22, 2013, 10:47:54 pm »
Something like this would be incredibly hard to implement properly, while still maintaining backwards compatibility. How are you swapping the graphics? If its from a script, then perhaps you could update these too while doing it?

robin.fischer

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Anchors and Colliders on Textures in % instead of pixels.
« Reply #2 on: November 28, 2013, 09:11:15 am »
Hi unikronsoftware,


thank you for your quick reply and forgive me my late response.

I scale the Images with a Script. But this script is a shell script using Image Magic and not a C#/JavaScript in Unity itself.


It would just be nice to replace a Texture with the same double sized Texture and every Setting would be the same. :) But I can also find ways of doing this by modifying tk2d or scaling it from a script and updating the Anchor and Collider Values.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Anchors and Colliders on Textures in % instead of pixels.
« Reply #3 on: November 28, 2013, 10:59:53 am »
It is really really easy to modify this using a C#/JS editor script. I really recommend looking into it - you can run your imagemagick stuff, then immediately update the relevant bits inside the sprite collection object and rebuild.