• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

noBug Method OnLoading is not call during loading of image

mag

Active member
3rd Party Module Dev
3rd Party Tool Dev
Joined
Mar 5, 2018
Messages
261
I've come across an issue where the OnLoading method is not being called when I try to load images.
From my understanding, the OnLoading method should be triggered when images are being loaded, but for some reason, it's not working

Tested on cerberus-v2023-05-26 - Mojo2 - html5
I have attached a file that includes the relevant code
 

Attachments

  • 1.zip
    5 MB · Views: 50
Did you try on other targets? One thing is that image loading is done asynchronously for html5 target by default.
BTW I was already looking into async loading for Android, iOS and Desktop as well and also put it as default inside the Image.Load functionality but I got stuck a bit because of loading images from the web didn't go easily.
 
I never try on other platform yet. I can try on android and window desktop soon.
 
If I remember. OnLoading only works with mojo and html.
 
Correct. I just went through the code for Android, iOS and glfw. There is no sign of triggering OnLoading.
And the reason it is not working on mojo2 html5 target is that loading is handled in the opengl2 module itself.
 
Possibly the best way to handle detection loading of images with mojo2 and html is manually, with Loading().
 
If I remember. OnLoading only works with mojo and html.
Yes you right, I try in mojo 1 html5 and it work. Just for easy try, I attach the code for mojo1.
So I guess it can be done in html then.
This feature is great for accurately displaying a loading page.
I will try for other platform soon
 

Attachments

  • 2.zip
    5 MB · Views: 55
You could also try Image.ImagesLoading:Bool() or what might be even more valuable for showing an accurate loading screen: Texture.TexturesLoading:Int(). The last one returns the amount of Textures that are still loading.
I haven't tried them yet but I think they should give you a proper way of knowing if there is some image loading going on when you are doing your OnRender() method.
 
  • Like
Reactions: mag
Code:
    Method OnRender()
        If Image.ImagesLoading()
            OnLoading()
        Else
            ...
            canvas.Flush()   
        Endif
    End
Adding this code making OnLoading() works good
 
Back
Top Bottom