[SOLVED] How to show Percentage Number in loading screen instead of loading bar

Hie everyone ,Can anyone help how to show percentage number in playcanvas loading screen instead of loading bar

Hello @PlaycanvasDeveloper,

If you mean the application’s starting loading screen, you can customise it by adding elements and modifying the CSS. For your case in particular, you could add a text element and update it with a function like this:

var setProgress = function (value) {
        var text = document.getElementById('loading-text');
        if (text) {
            value = Math.min(1, Math.max(0, value));
            text.textContent = value * 100 + '%';

I highly encourage you to look at the link above, and start by modifying the default loading screen.

1 Like

yes I want to edit in application’s starting loading screen

Here is a project example: https://playcanvas.com/project/984876/overview/f-text-loading-screen


Thanks its working but I want values in integer only instead of float

Then change the code to match what you want to display. It’s down to you to customise the example to fit your needs

1 Like

Ok I will try ,

@yaustar @poliveira
Both of you Thanks again
Got mine output according to my needs so I marked this post [Solved]