Comments and answers for "Loading a sprite from URL C#"http://answers.unity.com/questions/1175862/loading-a-sprite-from-url-c.html
The latest comments and answers for the question "Loading a sprite from URL C#"Comment by A1A_PW on A1A_PW's answerhttp://answers.unity.com/comments/1568130/view.html
This works great in combination with the top comment!Fri, 02 Nov 2018 17:52:25 GMTA1A_PWAnswer by idbriihttp://answers.unity.com/answers/1567611/view.html
Instead of Sprite.Create, you may want to use WWW.LoadImageIntoTexture to ensure your image isn't downsampled by [QualitySettings][1] (the difference is very noticeable at "Eighth Res").
www.LoadImageIntoTexture(img.mainTexture as Texture2D);
[1]: https://docs.unity3d.com/Manual/class-QualitySettings.htmlWed, 31 Oct 2018 23:29:05 GMTidbriiComment by freedom667 on freedom667's answerhttp://answers.unity.com/comments/1469416/view.html
can be Resources.Load with URL? because I have a lot of picturesFri, 16 Feb 2018 12:10:33 GMTfreedom667Answer by creativeConnyhttp://answers.unity.com/answers/1426170/view.html
I wonder if there is any option to auto scale the aspect ratio of the downloaded image? In my case there is a placeholder with 800x600 pixels. So I want to keep the downloaded image's aspect ratio but cap its size to 800x600? Right now unity tries to fill my placeholder to its max...
EDIT: Ok found the solution by my self: At first I had not any source file in my image object. This caused the "preserve aspect ratio" button to not appear. After I inserted a placeholder image (before uploading one) the button appeared. Then just simply turn it on, now every time you upload a new image from url it keeps its aspect ratio! :)Thu, 26 Oct 2017 12:45:47 GMTcreativeConnyComment by deltron1830 on deltron1830's answerhttp://answers.unity.com/comments/1298267/view.html
Great answer. I did not know until now that Start (and other event handlers) can be made return IEnumerator and will be run as coroutines. Thats awesome!!Thu, 12 Jan 2017 20:01:32 GMTdeltron1830Comment by John3D on John3D's answerhttp://answers.unity.com/comments/1278529/view.html
Thanks for the solution. Works perfectly!Wed, 30 Nov 2016 13:56:11 GMTJohn3DAnswer by blazeasterhttp://answers.unity.com/answers/1176699/view.html
Solved thanks to the The Little Guy from unity forums!
<code>
public class ExampleClass : MonoBehaviour {
// The output of the image
public Image img;
// The source image
public string url = "http://images.earthcam.com/ec_metros/ourcams/fridays.jpg";
IEnumerator Start() {
WWW www = new WWW(url);
yield return www;
img.sprite = Sprite.Create(www.texture, new Rect(0, 0, www.texture.width, www.texture.height), new Vector2(0, 0));
}
}
</code>Mon, 25 Apr 2016 17:26:32 GMTblazeaster