Hey Guys i have a small question.
In my game i would like download an Picture or anything. And when i downloaded the picture or the file i would like Save it to my SD-Card or to my local hard drive on my Smartphone.
My Script :
var originalWidth = 1280.0; // define here the original resolution
var originalHeight = 720.0; // you used to create the GUI contents
private var scale: Vector3;
var url = "http://daswallpaper.de/wp-content/gallery/3_wallpaper_02/abstract_wallpaper_09.jpg";
var downloader: WWW = null;
function download (){
downloader = new WWW (url);
yield downloader;
if ( downloader != null )
{
// value between 0 and 1
print( "Download Progress: " + 100*downloader.progress + "C:/Apps" );
}
}
function OnGUI () {
scale.x = Screen.width/originalWidth; // calculate hor scale
scale.y = Screen.height/originalHeight; // calculate vert scale
scale.z = 1;
var svMat = GUI.matrix; // save current matrix
// substitute matrix - only scale is altered from standard
GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, scale);
GUI.enabled = true;
if(GUI.Button(new Rect(50,80,280,100), "Download")){
StartCoroutine("download");
}
// restore matrix before returning
GUI.matrix = svMat; // restore matrix
GUI.enabled = true;
}
Sry for my bad english ![]()
Thanks