Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Loading bar example

    Creation share codes
    useful function loading
    1
    1
    345
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • vinicity
      vinicity F last edited by vinicity

      So I did some experimenting in order to have a loading bar that would update while a program loads it’s assets.

      I tried various methods to have it update smoothly, but it seems that all threads are paused while assets are loading, so I had to settle for a bar that updates in chunks, as each asset is loaded.

      I chose to implement this in a function called by a timer. This way there is no need to call any extra code in between the asset load statements.

      The example is a small sound player which loads lots of music at the start. I have added comments so that it can be easily understood.

      The position, size, and colour of the loading bar can be changed by editing the variables on line 18-23.

      The global variable loadTime should be set to the total loading time of all assets. This can for instance be measured once using the time() function, as shown in the example.

      Feel free to use in your own projects!

      ID: XXSE2MND5C

      1 Reply Last reply Reply Quote 8
      • First post
        Last post