I would like to use ClipRect in Location :
![Image](http://www.zupimages.net/up/17/18/7fb9.png)
I take example on Manfred to write my code:
- Code: Select all
public static Image GetMiniature(Image image, String name)
{
LocationImage locImage = null;
// I search the good image
foreach(ArticyObject child in ((Location)GetInstance().m_miniatureLocation).Children)
{
if(((LocationImage)child).DisplayName == name)
{
locImage = (LocationImage)child;
break;
}
}
//take the clip rect
Rect uvrect = locImage.ClipRect;
Texture2D texture = ((Asset)locImage.ImageAsset).LoadAsset<Texture2D>();
image.sprite = Sprite.Create(texture, ArticyUtility.ConvertToSpriteSourceRect(texture, uvrect), new Vector2());
return image ;
}
But the result seem not good (here I forgot to make tru "preserve aspect", but the result it's same with it) :
![Image](http://www.zupimages.net/up/17/18/nvbh.png)
The image is enlarge. When I do a clip rect like a square it's look ok
Have you an idea on what I missed?
Thank you
Have a nice day,
Zeldarck