Search Unity

animated gif is not working

Discussion in 'iOS and tvOS' started by chishti, Aug 5, 2009.

  1. chishti

    chishti

    Joined:
    May 21, 2009
    Posts:
    188
    Hi

    I am using a animated gif that displays "Loading..."
    and while it is used in game play it don't displays the dots(...). Any Idea to display animated gif.

    Or Any other idea that we can display a loading screen that may contain the Loading bar or something like that.

    thanks in advance

    unityboy
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Unity doesn't have any support for animated gifs. It's a terrible format anyway; use a series of textures instead.

    --Eric
     
  3. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    you can not have any animation during loading anyway. Nothing on screen is beeing updated.
     
  4. jtbentley

    jtbentley

    Joined:
    Jun 30, 2009
    Posts:
    1,397
    If your'e using gif as your only format, you don't have anything to load anyway :)
     
  5. n_khan

    n_khan

    Joined:
    Aug 3, 2009
    Posts:
    1
    Hey dude, I am here.
    Better you use sequence of images (texture) to animate. Because there is no solution for animated gif in unity. :D
     
  6. chishti

    chishti

    Joined:
    May 21, 2009
    Posts:
    188
    thanks guys I got the point what I have to do.

    thanks to all again :)
     
  7. chishti

    chishti

    Joined:
    May 21, 2009
    Posts:
    188
    I have implemented the logic of rendering 4 images that have "Loading", "Loading.", "Loading..", "Loading...". I used GUI.Label (I have tried DrawTexture as well) to change them after certain number of frames in function OnGUI.

    Code (csharp):
    1.  
    2. var LoadingScreens : Texture[];
    3. function Start()
    4. {
    5.         Counter = 1;
    6.     i = 0;
    7. }
    8. function OnGUI()
    9. {
    10. GUI.Label(Rect(0, 0, 480, 320), LoadingScreens[i]);
    11.     Counter += 1;
    12.     if(Counter%100 == 0)
    13.         i+=1;
    14.    
    15.     if (i>3)
    16.     {       Counter = 0;
    17.         i=0;
    18.     }
    19. }
    20.  
    As a testing I used them in the menu back ground screen to render them it was working fine and the images were changing as expected.

    But the same Logic is not working when My level of game is being loaded after executing Application.LoadLevel("MyLevel"). Any Idea what Could be the reason. heavy processing or what ????

    thanks

    unityboy
     
  8. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    no
    after LoadLevel and until its fully loaded there is no world update nor any execution of anything.
    processing will continue after the load has been finished
     
  9. mehrdada

    mehrdada

    Joined:
    Jan 21, 2013
    Posts:
    5
    Hi,
    You can use
    Code (csharp):
    1.  Application.LoadLevelAsync("level name")
    istead to manage process in update function:

    Code (csharp):
    1. var progress:float;
    2.  
    3. function soemFunc(){
    4.  
    5. progress = Application.LoadLevelAsync("level name") .progress;
    6. }
    7.  
    8. function Update(){
    9. print(progress);
    10. }
    11.  
     
  10. Jtbentley_v2

    Jtbentley_v2

    Joined:
    Sep 5, 2012
    Posts:
    174
    I didn't think we could load levels asynchronously on iPhone..?
     
  11. Venryx

    Venryx

    Joined:
    Sep 25, 2012
    Posts:
    444
    Last edited: Mar 3, 2014
  12. WestHill

    WestHill

    Joined:
    Oct 29, 2012
    Posts:
    174
    Venryx likes this.
  13. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870