Closed stickylabdev closed 5 years ago
Yes, it is supposed to work on Android.
what i want is ,,iwant to change the sprite ,, imean something like changine the sprite of gameobject that contain spriterenderer ,,i want to make custom sprite where user can customize png image then applying to the game object through file manager
Does changing the "Filetype Icons" variable of the SimpleFileBrowserCanvas prefab not work for you?
i still dont understad how to do , if there some scene example it woulbe help me alot
Pada tanggal Rab, 1 Mei 2019 pukul 14.04 Süleyman Yasir KULA < notifications@github.com> menulis:
Does changing the "Filetype Icons" variable of the SimpleFileBrowserCanvas prefab not work for you?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yasirkula/UnitySimpleFileBrowser/issues/12#issuecomment-488223472, or mute the thread https://github.com/notifications/unsubscribe-auth/ADDY6YNIYUUMEITSBNZBNKLPTE6IVANCNFSM4HJJFE6Q .
yes i know , but how to get the png image to replece some image on sprite folder of the game ?
Pada tanggal Rab, 1 Mei 2019 pukul 20.58 Süleyman Yasir KULA < notifications@github.com> menulis:
[image: png] https://user-images.githubusercontent.com/10211608/57020545-3f704e00-6c32-11e9-8c13-6f133f062e5b.png
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yasirkula/UnitySimpleFileBrowser/issues/12#issuecomment-488289206, or mute the thread https://github.com/notifications/unsubscribe-auth/ADDY6YKYJVXPTCYDYO2EVHTPTGOXVANCNFSM4HJJFE6Q .
so i have to do something here
private void OnOperationSuccessful( string path ) { Success = true; Result = path;
//Hide();
if( onSuccess != null )
onSuccess( path );
onSuccess = null;
onCancel = null;
}
but i dont know how to do bro
Pada tanggal Kam, 2 Mei 2019 pukul 02.51 Muafakul Khoir < alhunaidah@gmail.com> menulis:
yes i know , but how to get the png image to replece some image on sprite folder of the game ?
Pada tanggal Rab, 1 Mei 2019 pukul 20.58 Süleyman Yasir KULA < notifications@github.com> menulis:
[image: png] https://user-images.githubusercontent.com/10211608/57020545-3f704e00-6c32-11e9-8c13-6f133f062e5b.png
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yasirkula/UnitySimpleFileBrowser/issues/12#issuecomment-488289206, or mute the thread https://github.com/notifications/unsubscribe-auth/ADDY6YKYJVXPTCYDYO2EVHTPTGOXVANCNFSM4HJJFE6Q .
can you make example how to change that sprite ?
I see. You have to use the onSuccess event of the ShowLoadDialog function:
FileBrowser.ShowLoadDialog( ( path ) =>
{
// Here, create a texture from the image at "path"
// Google "unity load image runtime" to see how
}, null );
still failed ,,can you give me the correct example ?
can you give me spesific example ,please , i always failed , cry
private void OnOperationSuccessful (string path) {
Success = true;
Result = path;
//Hide();
Debug.Log (path);
if (onSuccess != null)
onSuccess (path);
onSuccess = null;
onCancel = null;
//LoadPNG(path);
idontknow (path);
}
public void idontknow (string path) {
// FileBrowser.ShowLoadDialog ((path) => {
// Here, create a texture from the image at "path"
// Google "unity load image runtime" to see how
Sprite tex = null;
byte[] fileData;
if (File.Exists (path)) {
fileData = File.ReadAllBytes (path);
tex = new Sprite ();
//tex.LoadImage (fileData); //..this will auto-resize the texture dimensions.
sr.sprite = tex;
}
//}
//}, null);
}
still failded ,can you help me please ?
public void idontknow( string path )
{
FileBrowser.ShowLoadDialog( ( path ) =>
{
if( File.Exists( path ) )
{
byte[] fileData = File.ReadAllBytes( path );
Texture2D tex = new Texture2D( 2, 2 );
tex.LoadImage( fileData );
Sprite sprite = Sprite.Create( tex, new Rect( 0f, 0f, tex.width, tex.height ), new Vector2( 0.5f, 0.5f ), 100f );
sr.sprite = sprite;
}
}, null );
}
cool ,,is it possible to save sprite data in the player prefs or save load playerinfo.bat
You can save the path of the file in PlayerPrefs. If you worry about the file getting deleted at some stage, you can copy it to Application.persistentDataPath via File.Copy and then save the path of the copied file.
i will think about it ,and a lot of try and errors ,thanks
Pada tanggal Jum, 3 Mei 2019 pukul 23.31 Süleyman Yasir KULA < notifications@github.com> menulis:
You can save the path of the file in PlayerPrefs. If you worry about the file getting deleted at some stage, you can copy it to Application.persistentDataPath via File.Copy and then save the path of the copied file.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yasirkula/UnitySimpleFileBrowser/issues/12#issuecomment-489158676, or mute the thread https://github.com/notifications/unsubscribe-auth/ADDY6YPETBMIP4CKYRBGT3DPTRSHVANCNFSM4HJJFE6Q .
i hope it can