We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

How to access the onWindowResize function in Verge3D?

Home Forums Programming How to access the onWindowResize function in Verge3D?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #77359
    Ignacio Díaz
    Customer

    Hello Verge3D community,
    I was wondering if there is a built-in method that automatically handles window resizing. Specifically, I want to check if there’s a way to directly access or reference the function. Here is the context code:

    onWindowResize();
    
    if ('ontouchstart' in window) {
        document.addEventListener('touchmove', move);
    } else {
        window.addEventListener('resize', onWindowResize, false);
        document.addEventListener('mousemove', move);
    }
    

    Thank you for your guidance!
    Best regards,
    Ignacio

    #77397

    Hi Ignacio,

    You can use the following code to override the built-in app.onResize() function:

    const onResizeOld = app.onResize;
    
    app.onResize = function() {
        onResizeOld.call(app);
        // place your code here
        console.log("Resized!");
    }

    Same with Puzzles:

    Attachments:
    You must be logged in to view attached files.

    Soft8Soft Tech Chief
    X | FB | LinkedIn

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.